Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21] tell mysql to ignore the sort index for search queries #29322

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

icewind1991
Copy link
Member

nc21 version of #29300

Signed-off-by: Robin Appelman <robin@icewind.nl>
mysql really likes to pick an index for sorting if it can't fully satisfy the where
filter with an index, since search queries pretty much never are fully filtered by index
mysql often picks an index for sorting instead of the *much* more useful index for filtering.

To bypass this, we tell mysql explicitly not to use the mtime (the default order field) index,
so it will instead pick an index that is actually useful.

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Oct 21, 2021
@icewind1991 icewind1991 added this to the Nextcloud 21.0.6 milestone Oct 21, 2021
@icewind1991 icewind1991 changed the title tell mysql to ignore the sort index for search queries [21] tell mysql to ignore the sort index for search queries Oct 21, 2021
@blizzz blizzz mentioned this pull request Nov 3, 2021
10 tasks
@skjnldsv skjnldsv merged commit 07c20b4 into stable21 Nov 4, 2021
@skjnldsv skjnldsv deleted the mysql-search-ignore-index-21 branch November 4, 2021 08:00
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 4, 2021
@PVince81
Copy link
Member

PVince81 commented Nov 4, 2021

the master PR and NC 22 PRs are not merged, revert ?

ref #29300

@skjnldsv
Copy link
Member

skjnldsv commented Nov 4, 2021

/backport to stable21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants