-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
generate a better optimized query for path prefix search filters #28608
Conversation
Signed-off-by: Robin Appelman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine 👍
Assuming this won't affect other database engines negatively
/backport to stable22 |
/backport to stable21 |
/backport to stable20 |
The backport to stable21 failed. Please do this backport manually. |
The backport to stable20 failed. Please do this backport manually. |
see #29080 for the 21 and 20 backports |
If we're already doing a
path LIKE "$prefix/%"
then doing apath = "$prefix"
doesn't incur the cost it normally does compared topath_hash = md5("$prefix")
, and by only selecting on thepath
column instead of 2 columns the same index can be used for both comparisons.Combined with #28541 this gets mysql to do a proper indexed search (in my testing at least)