lance-format / lance-format/lance
Design better compaction criteria
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
Current issues:
- Existing implementation only compacts fragments that are adjacent. Given that update and upsert operations re-order data anyways, it doesn't makes sense for us to limit ourselves like that.
- We have no criteria that will trigger compaction from horizontal fragmentation. For example, if a user replaces the vector column with a new one, the dropped column will still existing alongside other metadata files. We should detect that it's worth compacting those.
- Compaction planning doesn't differentiate the benefit of compacting small files vs compacting medium files. compaction has high ROI when many small files, but makes less sense when many medium or large files. For example, if we have 20 files each 4kb, it’s a no brainer to make those one 80kb file. But if we have 10 files each 100MB, is it actually worth rewriting as a single 1 GB file?
We should come up with a planner that is able to calculate these tradeoffs:
- What is the write amplification cost, including index remapping?
- What is the benefit to scan performance (high if many tiny files, low if files are sizeable)?
- What is the benefit to metadata overhead?
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
The issue names no files, tests, or entry points. Start by locating the current compaction planner and its tests, then determine how write amplification, index remapping, scan performance, and metadata overhead are represented; done means a decided planner design with criteria covering adjacent, horizontal, small-file, and larger-file compaction tradeoffs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100