diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-19 23:57:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-19 23:57:41 +0200 |
commit | b03366989424193ba6bcc6813ddb5ac1c1fa60d9 (patch) | |
tree | ea5dea301f7638106f2a6d0b44a6081367a5f33f | |
parent | 4751f1e7f766419fd013e5d6ddac4988e9158f5c (diff) | |
parent | 91d3e48ab30c7b195169edb1d07957c6b26f917f (diff) | |
download | nextcloud-server-b03366989424193ba6bcc6813ddb5ac1c1fa60d9.tar.gz nextcloud-server-b03366989424193ba6bcc6813ddb5ac1c1fa60d9.zip |
Merge pull request #10299 from nextcloud/fs-mtime-index
Add filecache index on mtime
-rw-r--r-- | core/Application.php | 8 | ||||
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 11 | ||||
-rw-r--r-- | core/Migrations/Version13000Date20170718121200.php | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php index 400d86f5991..336538187d7 100644 --- a/core/Application.php +++ b/core/Application.php @@ -71,6 +71,14 @@ class Application extends App { $subject->addHintForMissingSubject($table->getName(), 'parent_index'); } } + + if ($schema->hasTable('filecache')) { + $table = $schema->getTable('filecache'); + + if (!$table->hasIndex('fs_mtime')) { + $subject->addHintForMissingSubject($table->getName(), 'fs_mtime'); + } + } } ); } 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('<info>Adding additional mtime index to the filecache table, this can take some time...</info>'); + $table->addIndex(['mtime'], 'fs_mtime'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('<info>Filecache table updated successfully.</info>'); + } + } + if (!$updated) { $output->writeln('<info>Done.</info>'); } diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index 05623e435c3..29687b8683f 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -215,6 +215,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { $table->addIndex(['storage', 'mimetype'], 'fs_storage_mimetype'); $table->addIndex(['storage', 'mimepart'], 'fs_storage_mimepart'); $table->addIndex(['storage', 'size', 'fileid'], 'fs_storage_size'); + $table->addIndex(['mtime'], 'fs_mtime'); } if (!$schema->hasTable('group_user')) { |