Skip to content

Commit cc5ca58

Browse files
authored
Merge pull request #51438 from nextcloud/perf/db/cards-properties-abid-name-value-idx
perf(db): Extend index on cards_properties to cover name and value
2 parents 0051db7 + 8388646 commit cc5ca58

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

apps/dav/lib/Migration/Version1004Date20170924124212.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
2828
$table->addIndex(['addressbookid', 'uri'], 'cards_abiduri');
2929

3030
$table = $schema->getTable('cards_properties');
31-
$table->addIndex(['addressbookid'], 'cards_prop_abid');
31+
// Removed later on
32+
// $table->addIndex(['addressbookid'], 'cards_prop_abid');
33+
// Added later on
34+
$table->addIndex(['addressbookid', 'name', 'value'], 'cards_prop_abid_name_value', );
3235

3336
return $schema;
3437
}

core/Application.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ public function __construct() {
147147
true
148148
);
149149

150-
$event->addMissingIndex(
150+
$event->replaceIndex(
151151
'cards_properties',
152-
'cards_prop_abid',
153-
['addressbookid'],
154-
[],
155-
true
152+
['cards_prop_abid'],
153+
'cards_prop_abid_name_value',
154+
['addressbookid', 'name', 'value'],
155+
false,
156156
);
157157

158158
$event->addMissingIndex(

0 commit comments

Comments
 (0)