Skip to content

Improve efficiency of filter query in Postgres#2401

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
LevoLeague:postgres-efficient-filtering
Sep 15, 2015
Merged

Improve efficiency of filter query in Postgres#2401
mshibuya merged 1 commit into
railsadminteam:masterfrom
LevoLeague:postgres-efficient-filtering

Conversation

@dwbutler

Copy link
Copy Markdown
Contributor

In Postgres, filter queries currently generate a condition LOWER(field) ILIKE ?. This defeats the benefit of using ILIKE, which is case insensitive, and also prevents an index from being used. This fixes the issue by changing the condition to field ILIKE ? in Postgres.

In Postgres, filter queries currently generate a condition `LOWER(field) ILIKE ?`. This defeats the benefit of using ILIKE, which is case insensitive, and also prevents an index from being used. This fixes the issue by changing the condition to `field ILIKE ?` in Postgres.
mshibuya added a commit that referenced this pull request Sep 15, 2015
Improve efficiency of filter query in Postgres
@mshibuya mshibuya merged commit 35c3d64 into railsadminteam:master Sep 15, 2015
@mshibuya

Copy link
Copy Markdown
Member

Thanks!

@dwbutler

Copy link
Copy Markdown
Contributor Author

Thanks for the quick response!

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