PostgREST / PostgREST/postgrest
Ensure an index is applied for LIKE/ILIKE and regex
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 27.7k
- Forks
- 1.2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 54
Description
From https://github.com/PostgREST/postgrest/issues/2236#issuecomment-1089445976.
pg_trgm does apply an index to queries for like/ilike/regex, however it depends on the shape of the input - which might be hard to normalize as discussed in https://github.com/PostgREST/postgrest/issues/2236#issuecomment-1092170877.
Other ideas:
-
Using the query cost, but this might not be accurate as mentioned in https://github.com/PostgREST/postgrest/issues/2236#issuecomment-1089174610.
-
Somehow ensure a plan, like done on https://github.com/DrPostgres/pg_plan_guarantee.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked discussion in issue 2236, the pg_trgm documentation, and the pg_plan_guarantee example to understand the indexing and query-plan constraints. No implementation files or tests are named; the work is done when a concrete approach reliably ensures an index-backed plan for LIKE, ILIKE, and regex queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100