Repository navigation
Conversation
Hand-port of lance-format#10042 (b1a2a81) onto release-10.0.0. Each distinct filter's read projection and physical filter are planned once in plan_to_scoped_fragments and shared by Arc across fragments, instead of a Planner::new + create_physical_expr + projection union per fragment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
zehiko
force-pushed
the
zeljko/scan-per-fragment-overhead
branch
from
October 23, 2026 12:18
f49d1ff to
42853b1
Compare
Cherry-pick of lance-format#9614 (2c4934c), exec.rs and planner.rs only; the utils.rs doc note and regression test depend on SharedPreFilterExec, which release-10.0.0 does not have. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
zehiko
force-pushed
the
zeljko/scan-per-fragment-overhead
branch
from
October 23, 2026 12:34
42853b1 to
faeaace
Compare
amunra
approved these changes
Oct 23, 2026
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.
Related
What
Two upstream changes, one commit each.
perf(scan): share one planned filter across all fragments of a scan(perf(scan): share one planned filter across all fragments of a scan lance-format/lance#10042).read_fragmentused to build aPlannerand re-derive the read projection for every fragment.Now
plan_to_scoped_fragmentsplans the read projection and physical filter once per distinct filter, and every fragment reuses them.The upstream commit does not apply cleanly here, because it builds on perf: share one ScanScheduler per base within a scan lance-format/lance#9417 (
base_schedulers) and the blob-materialization context, which this branch doesn't have.This commit carries the same change adapted to
release-10.0.0, including both upstream tests.perf(datafusion): stop cloning the session state for every execution(perf(datafusion): stop cloning the session state for every execution lance-format/lance#9614).LanceContextProviderkeeps the cachedSessionContextinstead of cloningSessionState, soPlanner::newno longer copies DataFusion's function registry.The
utils.rspart of the upstream change depends onSharedPreFilterExec, which this branch doesn't have, and is left out.Expected wins
Filtered scans over many small fragments should use about 20–25% less CPU per scan.
The saving comes from fixed work that used to be repeated for every fragment.
Scans dominated by decoding large fragments see little change.
Measured on a small filtered scan (4-column projection, a
layer = … AND segment_id IN (…)filter, release build, 6 cores):For the dataplatform writer, these scans are 30–40% of its CPU during incremental registration, so the expected saving there is roughly 7–10% of writer CPU.
Testing
cargo test -p lance --lib: 2693 passed, 0 failed, 3 ignored.cargo test -p lance-file: 141 passed.cargo test -p lance-datafusion --features substrait: 85 passed. The perf(datafusion): stop cloning the session state for every execution lance-format/lance#9614 tests userstest, solance-datafusiongains it as a dev-dependency (already a workspace dependency).test_planned_filter_encoded_once.Compatibility
No API, format or behavioural change.
Both commits drop out when moving to a Lance release that contains lance-format#10042 and lance-format#9614 (v14.0.0 pre-releases onward).
Agent
🤖 This PR was opened by a coding agent (Claude Opus 5.5).