Repository navigation
perf(index): cache query-visible index listings per snapshot - #10619
Merged
Xuanwo merged 10 commits intoNov 14, 2026
Merged
Conversation
Contributor
Author
|
@wjones127, could you review the proposed snapshot-cache approach or route it to the index maintainer? @tianfy17, your benchmark from #10414 would be useful for comparing this patch against the same baseline. This remains a draft: local Clippy passed, but local runtime tests and the post-fix benchmark are still outstanding. GitHub also reports merge conflicts and failures in the platform build jobs. Guidance on the design and the validation needed before this can move toward merge would help. |
karthiksenv
marked this pull request as ready for review
November 6, 2026 04:00
Keep main's independent-covering malformed fixture in dataset/index.rs and this branch's cache clear before the injected raw metadata. In index/lifecycle.rs keep the typed query-listing cache with its shared derivation and retry_derivation recovery; that supersedes main's separate details_pending/unverifiable guard, which implemented the same retry.
Without a manifest e-tag the query-listing key has no generation token, so a dataset dropped and recreated at the same URI could alias a previous incarnation's version. Skip the shared query cache entirely in that case: derive the listing for the call and neither read nor publish an entry, matching the row-id index's existing guard. The new regression seeds a stale listing under the version-only key and checks that it is neither served nor replaced; the correctness case checks an untagged snapshot still loads its real indices and publishes nothing. Also update the comments that still described the pre-merge "never cache" behavior.
The public `DerivedIndexListingKey` doc comment linked to the crate-private `QueryIndexListingKey`, so `RUSTDOCFLAGS="-D warnings" cargo doc` failed on rustdoc::private_intra_doc_links. Mention the private type as plain code instead; the docs keep the same meaning and the type stays private.
Contributor
Author
|
Hi @Xuanwo, this PR is ready for review, with all six CI workflows passing. Could you take a look when you have a chance and merge it if everything looks good? Thanks for your time! |
Xuanwo
approved these changes
Nov 14, 2026
Xuanwo
added a commit
to kamronis/lance
that referenced
this pull request
Nov 14, 2026
Brings the result-cache branch onto main e602c45, preserving the merged cross-column refinement (lance-format#9127), query-listing generation token (lance-format#10619), segment-contract rejection (lance-format#10761) and manifest/index replacement semantics (lance-format#10698).
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.
Warm-opening scalar index segments repeatedly processes the snapshot's complete index listing, including reader/version checks and filtering. With many segments, that repeats metadata work for each open. Refs #10414.
Cache the complete query-visible listing by store identity, manifest version, and ETag, and return its shared
Arc. The internal cache key keeps the publicDerivedIndexListingKeyvalue type unchanged. Listings with incomplete best-effort legacy vector-detail inference or an unreadable format marker retry derivation on later calls. Maintenance paths continue to useload_all_indices.A manifest without an ETag carries no generation token: a dataset dropped and recreated at the same URI restarts its version history, so a version-only key could alias the previous incarnation's listing.
load_indicestherefore derives the listing for that call without reading or publishing the shared cache entry, the same guardget_row_id_indexapplies. Regression tests seed a stale listing under the version-only key and check that an untagged snapshot neither serves nor replaces it.Extend concurrent-load coverage to check shared results, and add tests for inference recovery and index creation/drop/historical checkout. Update fixtures that replace metadata without committing a snapshot, and account for the memory-only query listing in cache-count and serialization tests. The warm remapping-plan test replaces both raw and query listings so it still verifies that warm opens use the cached plan.
The refresh in
542336ef1merges maine72e57140into the branch.9b1803285is the merge commit and already carries the production untagged-snapshot guard;542336ef1adds that guard's two regressions and updates the comments that described the pre-merge behavior. Merge resolutions keep main's independent-covering malformed fixture (covering_fields = vec![999, 999], #10662) together with this branch's cache clear, and keep the typed query listing with its shared derivation and retry flag instead of main's separatedetails_pending/unverifiableguard, which implemented the same retry. It also retains the explicit stable-row-ID lookup and accounts for that optional entry alongside raw metadata and query-listing entries in the ANN deletion test's cache count.Validation of
e8899219a(local)RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --profile ci --lockedfailed atsession/index_caches.rs:315before the change and passes after it. The publicDerivedIndexListingKeycomment linked to the crate-privateQueryIndexListingKey, so this commit turns that one link into plain code and leaves the type private. No other files or behavior change.cargo fmt --all -- --checkpassed.cargo clippy --all --tests --benches -- -D warningspassed in the dev profile without--profile ci --locked. The workspace Clippy run on542336ef1withcargo --profile ci --lockedis reused for this documentation-only delta.542336ef1were not rerun: this commit changes only one line of prose in a doc comment, so the compiled code and tests are identical.Validation of
542336ef1(local,cargo --profile ci --locked)cargo check -p lance --tests --benchespassed (5m31s).frag_reuse_reader123 passed; ANN deletion accounting 4 passed; serializing-backend prewarm 3 passed. No failures or ignored tests.cargo fmt --allandcargo fmt --all -- --checkare clean.cargo clippy --profile ci --locked --all --tests --benches -- -D warningspassed (5m58s).The first hosted run on
542336ef1exposed the strict-rustdoc failure fixed ine8899219a; otherwise the commit's behavior matches the local results above.Earlier validation of
4943992c5, before this refreshcargo fmt --alland the archived-source formatting check passed; fullcargo clippy --all --tests --benches -- -D warningspassed locally (90m09s) with all 2,756 archived source files and executable bits matching the tested source afterward.Validation of
2da95c718, before that mergerelease-no-lto, the same probe on base91ef50083and patch1d787fee5, and nine warm trials after one warm-up. Opening all 1,024 B-tree segments fell from a median 537.817 ms to 32.338 ms, about 16.6x faster. At 256 segments the medians were 40.232 ms and 2.960 ms. Both probes passed their segment-count assertions. These are measurements of those revisions, with the patched run first; an unrelated test suite was running during the baseline compilation and measurement.OpenAI Codex assisted with investigation, implementation, regression tests and validation.