perf: adopt Lance full-snapshot prefilter optimization - #88
Merged
yanghua merged 1 commit intoSep 29, 2026
Merged
Conversation
There was a problem hiding this comment.
The pinned v11 change skips the redundant row-ID load only when an explicit fragment scope covers the manifest and there is no prefilter predicate. The C regression passes for both row-ID modes and retains strict-subset filtering; the existing deletion, overlay, and unindexed-fallback paths remain in place.
Complete scopes can now use the existing 4-bit IVF_PQ bulk scorer, which can change candidates and reduce recall at a fixed refinement budget. The separate scoring fix is merged on main but absent from this v11 pin. Recall-sensitive callers should benchmark this query shape and adjust refinement if needed.
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
Explicitly selecting every fragment in a snapshot should not require scanning every indexed row ID before ANN/FTS search. Adopt the Lance v11 prefilter optimization and loader statistics from lance-format/lance#9460, upstreaming the dependency update used in apache/doris#68408.
Pin all Lance dependencies to
db211492fc5cd9da5642d7234d9682de9be77c19. This revision includes lance-c's existing356acb0dependency, preserving vector segment compatibility validation. The lockfile changes only the 21 Lance source revisions; package versions, Arrow 58 dependencies, and the C ABI are unchanged.Add a C API regression test with two fragments and both stable and physical row IDs. It checks exact IVF_FLAT results, verifies that full explicit and implicit scopes scan the same number of rows without loading an allow set, and checks that strict fragment subsets still load and enforce their row-ID prefilter.
Dependency and compatibility
lance-format/lance#9460 is still open; this pins its tested integration revision. The optimization can select the existing bulk scorer: 4-bit IVF_PQ candidate recall at a fixed refinement budget may change. The separate scoring fix in lance-format/lance#9537 on main is not included in this v11 update. See the upstream PR for the detailed compatibility discussion.
Validation
356acb0pin: an explicit full scope scans 69 rows versus 5 for the implicit scope. The same test passes with the new pin, including both row-ID modes and strict-subset counters.cargo fmt --all -- --check: passed.cargo clippy --locked --all-targets -- -D warnings: passed with Rust 1.91.0.cargo test --locked: 441 passed.cargo test --locked --test compile_and_run_test -- --ignored: all three passed (C, C++, and static-library OSS transport).