From ed84f07784c2b991cd5adc95f94b04908564afd3 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 23 Dec 2021 11:34:51 +0100 Subject: Add missing index for propertypath only queries against properties Signed-off-by: Christoph Wurst --- core/Command/Db/AddMissingIndices.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/Command') diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 57fa49149f6..4c86a8705db 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -316,11 +316,24 @@ class AddMissingIndices extends Command { $output->writeln('Check indices of the oc_properties table.'); if ($schema->hasTable('properties')) { $table = $schema->getTable('properties'); + $propertiesUpdated = false; + if (!$table->hasIndex('properties_path_index')) { $output->writeln('Adding properties_path_index index to the oc_properties table, this can take some time...'); $table->addIndex(['userid', 'propertypath'], 'properties_path_index'); $this->connection->migrateToSchema($schema->getWrappedSchema()); + $propertiesUpdated = true; + } + if (!$table->hasIndex('properties_pathonly_index')) { + $output->writeln('Adding properties_pathonly_index index to the oc_properties table, this can take some time...'); + + $table->addIndex(['propertypath'], 'properties_pathonly_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $propertiesUpdated = true; + } + + if ($propertiesUpdated) { $updated = true; $output->writeln('oc_properties table updated successfully.'); } -- cgit v1.2.3