diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-11 16:37:23 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-10-08 18:38:25 +0200 |
commit | abd6b354acc7e930302ffacb2a7ec92dd88fcad7 (patch) | |
tree | 344ecbf230133540e14f9904122cee29cb817985 /core/Migrations | |
parent | 1ea5983568dc99aa80e52f18837629d137b8a03c (diff) | |
download | nextcloud-server-abd6b354acc7e930302ffacb2a7ec92dd88fcad7.tar.gz nextcloud-server-abd6b354acc7e930302ffacb2a7ec92dd88fcad7.zip |
add a prefix index to filecache.path
The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields,
which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column,
allowing us to add an index even if the column is to long.
Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places.
Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation.
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'core/Migrations')
-rw-r--r-- | core/Migrations/Version13000Date20170718121200.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index e8dbf1fc0fb..bb4f7e895a3 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -264,6 +264,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { $table->addIndex(['fileid', 'storage', 'size'], 'fs_id_storage_size'); $table->addIndex(['mtime'], 'fs_mtime'); $table->addIndex(['size'], 'fs_size'); + $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]); } if (!$schema->hasTable('group_user')) { |