From 84e933fab556ba99e906f718d9f726bee5838f24 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 12 Mar 2025 13:08:58 +0100 Subject: [PATCH] perf(db): Extend index on cards_properties to cover name and value Signed-off-by: Christoph Wurst --- .../lib/Migration/Version1004Date20170924124212.php | 5 ++++- core/Application.php | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/dav/lib/Migration/Version1004Date20170924124212.php b/apps/dav/lib/Migration/Version1004Date20170924124212.php index 4cc795e1aece5..34ff5d3ebc073 100644 --- a/apps/dav/lib/Migration/Version1004Date20170924124212.php +++ b/apps/dav/lib/Migration/Version1004Date20170924124212.php @@ -46,7 +46,10 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op $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 ffe4f60549c0f..2af80eca7bb00 100644 --- a/core/Application.php +++ b/core/Application.php @@ -171,12 +171,12 @@ public function __construct() { 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(