lance-format / lance-format/lance

Design better compaction criteria

Open
#4,485 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. 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.
  2. 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.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.