perf(table): keep clustered row ID ranges compact in index - #9501
Open
Abhisheklearn12 wants to merge 1 commit into
Open
Abhisheklearn12 wants to merge 1 commit into
Abhisheklearn12 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
This removes the per-row expansion identified in #9487 for compact ranges without deletions. The position-to-address mapping preserves lookups across gaps and shifted offsets, while overlapping chunks retain the existing merge path. The broader BTree replacement has separate prerequisites, so this scoped improvement can land independently.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #9311 introduced compact
Rangesrow ID segments, but mergedRowIdIndexconstruction expands them into per-row pairs even when there are no deletions. Keep the compact segment and map its positions to a contiguous address range.Tests cover gaps, shifted physical offsets, overlapping fragment spans, and batched lookups. The deletion-aware path and on-disk format are unchanged.
Fixes #9487.
Benchmark
BuildIndexClusteredRangesuses 100 fragments, 500,000 live IDs across 1,000,000 ID slots, and empty deletion vectors. Fixture construction is outside the timed loop. Both variants used the same benchmark andrelease-with-debugprofile with 30 Criterion samples. The baseline differs only by removal of the newRangesmatch arm.RangespathThis is about 164× faster for this synthetic index-build case. Dataset opening, storage I/O, and query latency were not measured.
Validation
cargo fmt --allcargo clippy --all --tests --benches -- -D warningscargo test -p lance-table rowids::(131 passed)