lance-format / lance-format/lance
Filtered read performance optimizations
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
There are a few bottlenecks in the planning phase of filtered reads that could probably be optimized. These are most noticeable when reading small amounts of data from a large dataset (e.g. applying a btree index) when all the data is in memory.
RowIdTreeMap::insert_rangeseems kind of slow. This makesRowIdTreeMap::from(range)slow which meansRowIdSequence::mask_to_offset_rangesis slow which meansapply_index_resultinFilteredReadStream::create_planis slow.- The
apply_index_resultstep is run once for each fragment, in serial order. It is not parallelized because that would mess uprange_offsetandfiltered_range_offset. However, we could probably calculate just those offsets first (in a vec) and then parallelize theapply_index_resultstep
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 reading RowIdTreeMap::insert_range and tracing its use through RowIdTreeMap::from, RowIdSequence::mask_to_offset_ranges, and FilteredReadStream::create_plan. Examine how range_offset and filtered_range_offset are calculated before changing the serial apply_index_result work. Done means filtered-read planning is measurably faster while preserving correct offsets and results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-engineering, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100