Skip to content

fix: plan each root's lifecycle against its own entries - #513

Merged
zzylol merged 1 commit into
mainfrom
fix/per-root-lifecycle-demand
Oct 1, 2026
Merged

zzylol merged 1 commit into
mainfrom
fix/per-root-lifecycle-demand

Conversation

@zzylol

@zzylol zzylol commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Why

When MajorPass assembled each root, it planned that root's summary-maintenance lifecycle against all workload entries (0..len). So each root's expected reads, accuracy targets and prepared-state eligibility were those of the whole workload. Selection already costs each target only against its own entries, so assembly disagreed with it.

What

Assembly now uses the same per-target entry binding as selection (workload_entries_by_target). A root shared by several entries still sees all of them.

Before / After

Example: one query read every minute and an unrelated query read every ten minutes, over one hour. Expected reads per plan go from [66, 66] to [60, 6].

Validation

  • New test: each_plan_counts_only_its_own_entries_reads (crates/planner/tests/e2e_plan.rs).
  • Passes on Rust 1.99: cargo fmt --check, clippy with -D warnings, and the MetricsQL baseline. The full workspace test run is in progress locally and in CI.

This is a prerequisite for sharing summaries across queries (logical Pass 2 in #509): a shared summary's cost is only right if each root's demand is right.

🤖 Generated with Claude Code

MajorPass bound every root's lifecycle assembly to all workload entries,
so a root's expected reads, accuracy targets and prepared-state
eligibility were the whole workload's. Selection already costs each
target against the entries whose roots reach it; assembly now uses the
same binding (`workload_entries_by_target`), so roots shared by several
entries still see all of them and unrelated queries no longer amortize
each other's state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol merged commit 4255563 into main Oct 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant