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 #29924

Closed
wants to merge 2 commits into from

Conversation

icewind1991
Copy link
Member

Backport 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 marked this pull request as draft November 26, 2021 14:21
@solracsf solracsf added the 2. developing Work in progress label Nov 29, 2021
@icewind1991 icewind1991 added this to the Nextcloud 21.0.8 milestone Nov 29, 2021
This was referenced Jan 7, 2022
This was referenced Jan 20, 2022
@blizzz
Copy link
Member

blizzz commented Feb 11, 2022

@icewind1991 what's the future of this PR?

@blizzz blizzz closed this Mar 21, 2022
@skjnldsv skjnldsv deleted the mysql-search-ignore-index-21 branch March 14, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants