From 91d3e48ab30c7b195169edb1d07957c6b26f917f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 19 Jul 2018 17:30:41 +0200 Subject: Add filecache index on mtime Gives searching by mtime and "recent" a proper index to use Signed-off-by: Robin Appelman --- core/Command/Db/AddMissingIndices.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/Command/Db') diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index b30fa43ab39..5d78d360b49 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -100,6 +100,17 @@ class AddMissingIndices extends Command { } } + if ($schema->hasTable('filecache')) { + $table = $schema->getTable('filecache'); + if (!$table->hasIndex('fs_mtime')) { + $output->writeln('Adding additional mtime index to the filecache table, this can take some time...'); + $table->addIndex(['mtime'], 'fs_mtime'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('Filecache table updated successfully.'); + } + } + if (!$updated) { $output->writeln('Done.'); } -- cgit v1.2.3