Skip to content

Conversation

@backportbot-nextcloud
Copy link

backport of #26070

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 <[email protected]>
@rullzer rullzer mentioned this pull request Mar 29, 2021
2 tasks
@rullzer rullzer merged commit f9cef32 into stable21 Mar 29, 2021
@rullzer rullzer deleted the backport/26070/stable21 branch March 29, 2021 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants