Skip to content

Commit 9d2c37b

Browse files
Merge pull request #52414 from nextcloud/backport/51438/stable30
[stable30] perf(db): Extend index on cards_properties to cover name and value
2 parents 8646b9e + a819f91 commit 9d2c37b

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
@@ -151,12 +151,12 @@ public function __construct() {
151151
true
152152
);
153153

154-
$event->addMissingIndex(
154+
$event->replaceIndex(
155155
'cards_properties',
156-
'cards_prop_abid',
157-
['addressbookid'],
158-
[],
159-
true
156+
['cards_prop_abid'],
157+
'cards_prop_abid_name_value',
158+
['addressbookid', 'name', 'value'],
159+
false,
160160
);
161161

162162
$event->addMissingIndex(

0 commit comments

Comments
 (0)