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

Use eq instead of matches for non-wildcard searches #1101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flickgradley
Copy link

@flickgradley flickgradley commented Mar 3, 2023

Context:

Thanks for such an excellent gem! We have over 60,000 tags in our database, and optimizing the LIKE and ILIKE operators is proving to be difficult. It seems like we don't need to use LIKE/ILIKE when doing exact tag matches (non-wildcard) - this PR changes the matches and matches_any operators to eq and eq_any, which would let us use a BTREE index on lower(name) to optimize these queries. We already use lower(name) when performing a case-insensitive search, so we don't need to use ILIKE as well.

@flickgradley flickgradley changed the title Use eq instead of matches for non-wildcard Use eq instead of matches for non-wildcard searches Mar 3, 2023
@flickgradley flickgradley marked this pull request as ready for review March 3, 2023 21:44
@ragingdave
Copy link

@mbleigh any progress on getting this into a new release? It would be hugely helpful

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.

2 participants