Repository navigation
[core] Cache BTree index readers across table scans - #1497
Draft
XiaoHongbo-Hope wants to merge 2 commits into
Draft
XiaoHongbo-Hope wants to merge 2 commits into
XiaoHongbo-Hope wants to merge 2 commits into
Conversation
XiaoHongbo-Hope
marked this pull request as draft
November 22, 2026 15:17
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.
Why
Each scan creates a new global-index scanner. Repeated queries on the same table reopen the same BTree shards and reread their footers and index blocks. That work remains on the warm-query path.
Change
Tablehandle and its copies. Readers are used exclusively and returned to an LRU cache capped at an estimated 128 MiB of reader metadata. Data blocks retain their separatebtree-index.cache-sizebudget.Validation
In a paired three-seed descriptor benchmark on an 8-vCPU ECS, adding
b24a2159to the #1504 baseline lowered median warm latency from 192 to 64 ms at 16 clips and from 289 to 134 ms at 100 clips. Lance measured 71 and 282 ms in the same run. All groups used default concurrency.The BTree cache and REST token refresh tests passed, including a delayed scan attaching after the cache has advanced to a newer credential generation.
AI-assisted change.