lance-format / lance-format/lance

consolidate bitmap segments and unindexed data on optimize

Open
#7,198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

What this PR does

unify its segment build path with the common scalar flow, teach optimize_indices to consolidate Bitmap segments and unindexed data in one pass with old-data filtering, and delete the legacy distributed shard machinery that main has already soft-broken.

1. Remove the legacy shard path

main already soft-broke the only entry point (merge_index_metadata for Bitmap returns "no longer supports merge_index_metadata"), so the shard machinery was unreachable dead code. Deleted ~450 lines: part_* shard files, train_bitmap_shard, K-way heap merge, merge_index_files.

  • shard_id is deprecated: ignored with a warning.
  • index_uuid is rejected for fragment-scoped BTree/Bitmap builds; segment UUIDs are generated by Lance.
2. optimize with old-data filtering
  • optimize_indices now consolidates N Bitmap segments + unindexed fragments in one pass (previously: full rebuild). A single segment still takes the streaming BitmapIndex::update path.
  • New OldIndexDataFilter::retain_row_addrs drops rows from retired fragments; merge_segments intersects segment coverage with live fragments instead of blindly unioning.
3. Unify the segment build path

Bitmap segment builds now go through the common build_scalar_index flow; the Bitmap-only special case in create.rs is deleted, and uses_segment_commit_path covers Bitmap uniformly (including IndexType::Scalar + bitmap params).

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

Start by tracing optimize_indices, merge_segments, and the common build_scalar_index flow, then read create.rs and the OldIndexDataFilter and BitmapIndex::update paths. Done means the legacy shard machinery is removed, Bitmap and unindexed data consolidate with retired-row filtering, and segment commit behavior is uniform as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.