aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2025-03-12 13:08:58 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-04-24 11:33:55 +0000
commita819f910b323d9a0d095c7622ceb3dd75fb9a06f (patch)
tree1389079a5de742980cf801c6f4ab7a58225bab84
parentc05d7b984d40b5baf5b697945af28d4c36e64395 (diff)
downloadnextcloud-server-backport/51438/stable30.tar.gz
nextcloud-server-backport/51438/stable30.zip
perf(db): Extend index on cards_properties to cover name and valuebackport/51438/stable30
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170924124212.php5
-rw-r--r--core/Application.php10
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/dav/lib/Migration/Version1004Date20170924124212.php b/apps/dav/lib/Migration/Version1004Date20170924124212.php
index a8b85469214..fbfec7e8e2d 100644
--- a/apps/dav/lib/Migration/Version1004Date20170924124212.php
+++ b/apps/dav/lib/Migration/Version1004Date20170924124212.php
@@ -28,7 +28,10 @@ class Version1004Date20170924124212 extends SimpleMigrationStep {
$table->addIndex(['addressbookid', 'uri'], 'cards_abiduri');
$table = $schema->getTable('cards_properties');
- $table->addIndex(['addressbookid'], 'cards_prop_abid');
+ // Removed later on
+ // $table->addIndex(['addressbookid'], 'cards_prop_abid');
+ // Added later on
+ $table->addIndex(['addressbookid', 'name', 'value'], 'cards_prop_abid_name_value', );
return $schema;
}
diff --git a/core/Application.php b/core/Application.php
index d2bcb18bafb..34e798a22bf 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -151,12 +151,12 @@ class Application extends App {
true
);
- $event->addMissingIndex(
+ $event->replaceIndex(
'cards_properties',
- 'cards_prop_abid',
- ['addressbookid'],
- [],
- true
+ ['cards_prop_abid'],
+ 'cards_prop_abid_name_value',
+ ['addressbookid', 'name', 'value'],
+ false,
);
$event->addMissingIndex(