summaryrefslogtreecommitdiffstats
path: root/core/Application.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-11 16:37:23 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-03-26 19:44:28 +0000
commit861fbd06a5d7c9100ea2f8fedee43f68c2396054 (patch)
treef82b30d4aa58d8f3656e5ac371325cd340474487 /core/Application.php
parent785f6c63a0a9519917821cfed348c1aa28970af8 (diff)
downloadnextcloud-server-861fbd06a5d7c9100ea2f8fedee43f68c2396054.tar.gz
nextcloud-server-861fbd06a5d7c9100ea2f8fedee43f68c2396054.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/Application.php')
-rw-r--r--core/Application.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index c3cb6f02ed5..93032e53d42 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -112,6 +112,10 @@ class Application extends App {
if (!$table->hasIndex('fs_size')) {
$subject->addHintForMissingSubject($table->getName(), 'fs_size');
}
+
+ if (!$table->hasIndex('fs_path_prefix')) {
+ $subject->addHintForMissingSubject($table->getName(), 'fs_path_prefix');
+ }
}
if ($schema->hasTable('twofactor_providers')) {