lance-format / lance-format/lance
Support logical OR of `IndexedExpression` when there is both a `scalar_query` and a `refine`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
Currently we do not take advantage of the index when the query is something like this (assume "color" is indexed and "size" is not indexed)
(color == 'blue' AND size < 20) OR (color == 'red' AND size < 50)
We should be able to rewrite this to:
(color == 'blue' OR color == 'red') AND ((color == 'blue' AND size < 20) OR (color == 'red' AND size < 50))
The first part can become an index lookup and then the second part can become the refine expression.
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 by locating the IndexedExpression handling for queries containing both scalar_query and refine. Trace how the example OR expression is currently processed, then verify that the indexed portion can be extracted while the full condition remains as the refine expression. Done means the documented rewrite is supported without losing either condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100