Skip to content

feat: add segmented BTree index planning and merge support#6889

Open
zhangyue19921010 wants to merge 4 commits into
lance-format:mainfrom
zhangyue19921010:btree-full-support-segment-final
Open

feat: add segmented BTree index planning and merge support#6889
zhangyue19921010 wants to merge 4 commits into
lance-format:mainfrom
zhangyue19921010:btree-full-support-segment-final

Conversation

@zhangyue19921010
Copy link
Copy Markdown
Contributor

Summary

This PR adds segmented index plan, merge, and optimize support for BTree scalar indexes.

What Changed

  • Adds a BTree implementation for the segmented index builder.

    • Supports planning staged BTree segments.
    • Supports 1:1 passthrough when segments do not need consolidation.
    • Supports N:1 consolidation when target_segment_bytes is set.
  • Adds BTree support to merge_existing_index_segments.

    • Merges multiple existing BTree segments into one physical segment.
  • Adds a lower-level BTreeIndex::merge_segments API.

    • Merges multiple BTree indexes plus optional new training data.
  • Extends scalar index optimize support for multi-segment BTree indexes.

    • Can merge multiple existing BTree segments with newly appended fragments.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the enhancement New feature or request label May 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 80.14706% with 189 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/index/scalar/btree.rs 57.82% 76 Missing and 21 partials ⚠️
rust/lance/src/index/append.rs 85.02% 47 Missing and 18 partials ⚠️
rust/lance-index/src/scalar/btree.rs 63.63% 18 Missing and 6 partials ⚠️
rust/lance/src/index/create.rs 98.61% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the java label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant