diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-11-30 16:30:21 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-11-30 20:51:48 +0100 |
commit | 0ccf84bb3174a0dba47938888d104db96dcacb1b (patch) | |
tree | a4f19dd82611725e9409d3dfeb47dcd4b9dcf824 /core/Application.php | |
parent | 3cd1d74a815531c9b7ae25ebbf8e7c45fa566e74 (diff) | |
download | nextcloud-server-0ccf84bb3174a0dba47938888d104db96dcacb1b.tar.gz nextcloud-server-0ccf84bb3174a0dba47938888d104db96dcacb1b.zip |
perf: Add partial index on configvalue of preferences table
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/Application.php')
-rw-r--r-- | core/Application.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php index 2ad8b9f2a30..b033ea70871 100644 --- a/core/Application.php +++ b/core/Application.php @@ -44,6 +44,7 @@ use OC\Authentication\Listeners\UserDeletedWebAuthnCleanupListener; use OC\Authentication\Notifications\Notifier as AuthenticationNotifier; use OC\Core\Listener\BeforeTemplateRenderedListener; use OC\Core\Notification\CoreNotifier; +use OC\SystemConfig; use OC\TagManager; use OCP\AppFramework\App; use OCP\AppFramework\Http\Events\BeforeLoginTemplateRenderedEvent; @@ -81,6 +82,7 @@ class Application extends App { $notificationManager->registerNotifierService(AuthenticationNotifier::class); $eventDispatcher->addListener(AddMissingIndicesEvent::class, function (AddMissingIndicesEvent $event) { + $dbType = $this->getContainer()->get(SystemConfig::class)->getSystemValue('dbtype', 'sqlite'); $event->addMissingIndex( 'share', 'share_with_index', @@ -237,6 +239,15 @@ class Application extends App { ['appid', 'configkey'] ); + if ($dbType !== 'oci') { + $event->addMissingIndex( + 'preferences', + 'preferences_configvalue', + ['configvalue'], + ['lengths' => [80]] + ); + } + $event->addMissingIndex( 'mounts', 'mounts_class_index', |