Skip to content

feat(cost): IN-list selectivity for SIL bindings, the top-k share under a declared skew, and the compensation filter below the window merge - #1559

Draft
zzylol wants to merge 8 commits into
feat/sil-intentfrom
feat/sil-inlist-selectivity
Draft

zzylol wants to merge 8 commits into
feat/sil-intentfrom
feat/sil-inlist-selectivity

Conversation

@zzylol

@zzylol zzylol commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: the cost model ignored IN-lists. A SIL dependent query host IN $Y (10 of 10,000 hosts) was priced as reading every host, so E6 drill_cnt x1 cost 177.91/s on demand and the planner kept a (host, user) lightcone (169.26/s).
  • Change:
    • A Scan's predicates and a Filter keep their IN-lists' share of the rows. That share is k/N, or the top-k Zipf mass when the sources declare a skew and the values are a binding from an upstream count-ranked top-k.
    • In Pass 2, the compensation filter can run below the window merge.
  • Effect: drill_cnt x1 costs 28.90/s in all three modes; the lightcone is not kept. Forced onto the lightcone, it costs 89.03/s instead of 169.26/s.

Stacked on #1553 (base feat/sil-intent). The draft #1555 (cost calibration) stacks on this branch. The per-row constants (scan vs merge) are being recalibrated separately in #1555, so the absolute numbers below may still move.

Review guide

  • Base: feat/sil-intent (feat(sil): plan SIL intents: parse/check, lowering, hole guard, planning modes, group latency (L_G) #1553), rebased on its head b9c7fdf.
  • Commits, in order:
    1. Failing tests (phase 3).
    2. feat(cost): IN-list selectivity and the skew share.
    3. feat(pass2): the filter below the window merge.
    4. test: test definitions that changed (listed below), plus the skew tests.
    5. Three fixes found while running E6:
      • a regrouping merge of filtered windows folds its windows exactly;
      • a key filter over states keeps the values' share of them;
      • under skew, each kept state folds its heavier key's rows.
  • Read first: crates/cost/src/node/usage/kept_share.rs, the whole rule. share_of_rows_of_values is the one function a skew estimate replaces.
  • Then, in crates/cost/src/node/usage/mod.rs:
    • the computation of kept_by_predicate;
    • the Scan arm: at query time it reads only the selected rows; at ingestion time it sees every row;
    • the Filter branch of the pass-through arm;
    • rows_read at ingestion time, which now uses the input's rate;
    • the regrouping merge's states per group.
  • Pass 2:
    • crates/stage1-pass2-reuse-candidates/src/rules/filter_below_window_merge.rs;
    • in crates/types/src/stages/logical/group/aggregate_coverage.rs: narrowed_by, and the window_end offset in regrouped.
  • Needs careful review:
    • unchanged_source_columns now passes columns through TimeRangeCover and SummaryMergeWindows;
    • Stage 3's input baseline merges kept_values_per_column;
    • StateInputRows::folds_the_same_as also accepts rows within 0.1%.
  • Mechanical:
    • heaviest_value_placeholders: Vec::new() added to DataWorkload literals in tests and frontends;
    • kept_values_per_column: BTreeMap::new() added to OutputFacts literals in cost tests.

Behavior: before → after

E6 drill_cnt x1, planned with asap_planner::intent::plan_intents under the default cost model (cost model 1):

INTENT drill_cnt EVERY 10s;
q1: ($Y, _) := SELECT host, count(*) AS c FROM flows WHERE ts > $now - INTERVAL '1 hour'
               GROUP BY host ORDER BY c DESC LIMIT 10 REQUIRE ERROR rel <= 0.05 DELTA 0.05;
q2: SELECT user, count(*) AS c FROM auth WHERE host IN $Y AND ts > $now - INTERVAL '10 minutes'
    GROUP BY user REQUIRE ERROR rel <= 0.05 DELTA 0.05;
-- auth: 10,000 rows/s; host 10,000, user 100,000 distinct; 100,000 series
before (3ef265d) after
q2's scan (on demand) 6,000,000 rows 6,000 rows (10/10,000 of the hosts)
q2's aggregate 6,000,000 rows into 100,000 groups, 139.07/s 6,000 rows into 100 groups
query at a time / on demand / full, cost per second 177.91 / 177.91 / 169.26 (lightcone kept) 28.90 / 28.90 / 28.90 (no lightcone)
forced onto the lightcone 169.26: filter after the time merge of 1,003,333 states 89.03: Filter(host IN …) over the 10 s windows, then merge by key (6,000 → 100 states)
with zipf_exponent_per_label {host: 1.0} declared (not expressible) the heaviest 10 hosts keep H_10/H_10000 = 0.2993 of the rows: on demand 35.49/s

This serves the eval (E6, the value of intents) and correctness: the predicted cost of a dependent query now follows the number of values bound.

Interfaces

crates/types/src/workload/data.rs

 /// What is known about one source. (Stays.)
 pub struct SourceFacts {
     pub series_count: Option<u64>,
     pub metric_type: Option<PrometheusMetricType>,
     pub column_signs: BTreeMap<String, ValueSign>,
     pub column_magnitudes: BTreeMap<String, ValueMagnitudeRange>,
     pub sample_interval: Option<DurationMs>,
     pub stream_norms: Option<StreamNorms>,
     pub max_distinct_per_evaluation: Option<u64>,
     pub distinct_values_per_label: BTreeMap<String, u64>,
+    /// The Zipf exponent s of rows over a label's values (rank i holds a share ∝ 1/i^s), e.g.
+    /// `{"host": 1.0}`. An IN-list of the heaviest k of N values keeps H_k(s)/H_N(s) of the rows.
+    /// Default: none (every IN-list keeps k/N). Omitted from JSON when empty.
+    pub zipf_exponent_per_label: BTreeMap<String, f64>,
     pub distinct_values_per_label_set: Vec<LabelSetDistinctValues>,
     pub rows_held: Option<u64>,
 }
 /// The data workload. (Stays.)
 pub struct DataWorkload {
     pub arrival: DataArrival,
     pub sources: BTreeMap<String, SourceFacts>,
+    /// The first placeholder of each SIL binding filled by an upstream count-ranked top-k
+    /// (`ORDER BY … DESC LIMIT k` lowered to `TopK`), which the intent lowering adds: an IN-list
+    /// holding one keeps the top-k share under the column's declared skew. Default: empty.
+    pub heaviest_value_placeholders: Vec<ScalarValue>,
 }

(SourceFacts is shown with the fields this PR leaves alone, as of #1553.)

crates/types/src/workload/assumed_data_fact.rs

 /// The default the planner used for one undeclared fact. (Stays.)
 pub enum DataFactAssumption {
     DDSketchValueMagnitudeRange { column: Option<String>, assumed_range: ValueMagnitudeRange },
     InOrderArrival,
+    /// An IN-list on `column` was costed at k/N of the rows because no source declares
+    /// `zipf_exponent_per_label` for it. Cost only: the accuracy guarantee does not depend on it.
+    UniformRowsPerValue { column: String },
 }

crates/types/src/workload/bounds.rs

 /// The groups a `by (keys)` is priced at. (Stays.)
 pub fn group_count_bound(
     keys: &GroupKeys,
     input: Option<&Schema>,
     sources: &BTreeSet<&str>,
     unchanged_input_columns: &BTreeSet<&str>,
     data: &DataWorkload,
     rows_read: u64,
+    /// The distinct values left of each column that IN-lists below restrict: a restricted key
+    /// counts its kept share; the declared series scale by every restricted column's share.
+    kept_values_per_column: &BTreeMap<&str, u64>,
 ) -> u64;

crates/cost/src/node/usage/mod.rs

 /// What one node outputs, as its consumers cost it. (Stays.)
 pub struct OutputFacts<'a> {
     pub statistics: EdgeStatistics,
     pub sources: BTreeSet<&'a str>,
     pub family: StateFamily<'a>,
     pub unchanged_columns: BTreeSet<&'a str>,
     pub tumbling_windows: f64,
     pub chain_tumbling_window_width_ms: Option<u64>,
     pub state_input_rows: Option<StateInputRows>,
     pub states_last_merged: bool,
     pub raw_rows_span_ms: Option<u64>,
     pub raw_rows_per_ms: Option<f64>,
     pub folded_per_row: Option<StateInputRows>,
     pub raw_rows_short_of_range: Option<RawRowsShortOfRange>,
     pub state_data_span_ms: Option<u64>,
     pub raw_rows_shifted_back_ms: u64,
+    /// The distinct values left of each source column that an IN-list below restricts, for the
+    /// columns passed on unchanged; absent means unrestricted. E.g. `host IN (10)` over `auth`:
+    /// `{host: 10}`.
+    pub kept_values_per_column: BTreeMap<&'a str, u64>,
 }

Usage, end to end (crates/planner-cli/tests/inlist_selectivity.rs::the_heaviest_bound_values_keep_their_zipf_share):

// The user's data facts: E6 drill_cnt x1, plus a declared Zipf(1) skew of auth's rows over host.
workload["data_workload"]["sources"]["auth"]["zipf_exponent_per_label"] = json!({"host": 1.0});
// What the SIL lowering adds for q1's `ORDER BY c DESC LIMIT 10`: q2's IN-list holds the heaviest
// hosts (asap_planner::intent::lower_intents fills it from `top_k_parts`).
workload["data_workload"]["heaviest_value_placeholders"] = json!([{"Utf8": "__sil_Y_0"}]);
// asap_planner --run-until stage3: Stage 3 costs q2's query-time Scan{auth, host IN (10 placeholders)}
// through node_resource_usage_and_cost → kept_share::share_of_rows_kept → share 0.2993.
let planned = plan(&workload, &capabilities(Values::Placeholders, true, &[]));
// q2's scan line: "scan 1795517 samples" (0.2993 × 6,000,000). With literal hosts (not marked): 6,000.

Algorithm changes

IN-list share (cost model)

  • Problem: Filter and Scan passed every row on, and their predicates were never read. In drill_cnt, q2 was charged 6,000,000 rows into 100,000 groups whatever |$Y| was.
  • Before / after:
    • Before: rows out = rows in.
    • Which conjuncts count: for a Scan's predicates or a Filter's, each conjunct that constraint_of reads as column IN (k), = v, or an OR of =, where the column is a source column passed on unchanged and N is declared.
    • Values left: values_after = min(k, values_before). A column restricted below keeps the values it has left.
    • Row share: multiplied by share_of_rows_of_values(after, before, zipf). That is H_after(s)/H_before(s) when the values are a heaviest-values binding and the column declares s, else after/before.
    • Value share: multiplied by after/before.
    • Rows: rows_kept(rows, share) (max(1, round(rows × share))); the rate is scaled too.
    • States: a filter over states keeps value_share of them, and each kept state folds share / value_share times the average rows.
    • Scans: a query-time Scan reads only the selected rows (Q1). An ingestion-time Scan sees every row and outputs the share.
    • Carried up: the restricted columns' values (kept_values_per_column).
      • group_count_bound counts a restricted key's kept share and scales the declared series.
      • Per-series groupings scale the declared series.
      • An ingestion-time grouping reads its input's rate.
  • Correctness:
    • Anything other than In keeps share 1. These still pass: U12–U14, T4, and E6 (177.9132 / 169.2572 / 140.9361 with host undeclared). Corpus snapshots, sketch snapshots and goldens are unchanged.
    • Each narrowing without a declared skew is warned once (UniformRowsPerValue).
  • Complexity: O(conjuncts) per Scan or Filter node. H_n(s) is exact up to 1,000 terms, then computed by Euler–Maclaurin (relative error ≤ 1e-14, checked against the exact sum).
  • Assumptions and limits:
    • Columns are independent.
    • Rows are uniform over values unless a Zipf exponent is declared.
    • Only count-ranked top-k bindings are "heaviest". rca's ORDER BY p99 DESC LIMIT 5 is not: its values are not the heaviest by rows.
    • NOT IN and ranges keep share 1 (Q3).

Compensation filter below the window merge (Pass 2)

  • Problem: the lightcone's compensation Filter could only read the time-merged state. The time merge paid for all 1,003,333 states whatever |$Y| was (34.09/s).
  • Before / after:
    • Before: Merge_by(user)(Filter(p, Merge(TimeRangeCover(levels)))).
    • After, also: Merge_by(user)(Merge_by(keys)(Filter(p', W))), where W is the chain windows (TimeRange or TimeRangeCover).
    • The new rule add_filters_below_window_merges runs after add_chain_groups, for every Filter on a state group's keys.
    • Coverage now derives for a key filter over windows (narrowed_by), and a regrouping merge maps keys past window_end.
  • Correctness:
    • Selecting keys commutes with merging per key.
    • The hole guard still holds: the new Filter holds the placeholders and runs only at query time (Q5-E3, hole_filter_never_runs_at_ingestion_and_bind_slots_name_it).
    • The kept chain holds no placeholder and is the same for every |$Y| (E2, S2).
  • Complexity: one candidate per pair of a key filter and a window merge.
  • Assumptions and limits:
    • The rule adds only a group-by merge, because a plain merge over a Filter of windows does not derive its schema.
    • The executor must run a regrouping SummaryMerge over a Filter of chain windows.

Decisions and open questions

Decided

  • 2026-12-03 (Q1): at query time, a raw read returns only the selected series. The backend is being fixed to push labels down.
  • 2026-12-03 (Q2): uniform k/N plus the UniformRowsPerValue warning. Superseded the same day by the next item.
  • 2026-12-03 (calibration item 6, user-approved): a skew-aware share for bindings from an upstream count-ranked top-k, H_k/H_N under a declared zipf_exponent_per_label. Uniform k/N, with the warning, only when no skew is declared. Rejected: matching placeholder text in the cost model; a separate skew type.
  • Q3: only In constraints count (IN, =, OR of =).
  • Q4: Stage 0 value bounds from IN-lists are a follow-up.
  • Q5: in scope; this PR implements it.
  • Q6–Q8: as in the test plan. One function, rounding by max(1, round), no extra latency test.
  • 2026-12-03: a filter over per-key states keeps the values' share of them, not the rows' share.

Test definitions that changed. These are definitions, not regressions:

  • E2, Q5-E3, S2: only the lightcone's chain build is compared across |$Y|. The wider levels the selection keeps now trade off against the query-time merge, which shrinks with |$Y|. E2 also no longer compares the windows each filter reads.
  • Q5-E2: now asserts at most 97/s, instead of ≈97 ± 2%. The selection found a cheaper shape: one 10 s level, filtered before the merge, 89.03/s.
  • S1: asserts that q2's time range grows 10× from |$Y| = 5 to 50, instead of q2's whole cost. The scan's kept raw data and the per-request cost do not scale with |$Y|.
  • planner_fuzz (l) ratio_witness_costs_over_the_shared_rate: the plain graft may now be the cheapest witness, because the numerator's label matcher keeps its share of the rows.
  • Pass 2 a_finest_common_group_no_query_asks_for_serves_both: the key filter over G* now also has the merge-over-filtered-windows candidates (14 = 7 + 7).

Needs reviewer decision: none blocking. StateInputRows::folds_the_same_as tolerates 0.1%; it only feeds a debug assertion.

Verification

Run on the build host, debug profile, at commit 0c51235. asap-cost, asap-planner and inlist_selectivity were re-run at 86ea4fd. Clippy is clean on all changed crates.

scope result newly failing vs base
asap-cost lib (U1–U16, kept_share unit tests) 156 passed 0
asap-types lib (T1–T4, W1) 222 passed 0
asap-stage1-pass2-reuse-candidates lib 40 passed 0
asap-stage3-plan-selection lib 57 passed 0
asap-planner --test planner (sil_intents S1–S3, the lowering marks the heaviest values) 94 passed, 1 ignored 0
asap-planner-cli planner_cli (inlist_selectivity E1–E9, Q5-M1, Q5-E1–E3) 90 passed, 2 ignored 0
asap-planner-cli corpus_snapshots / sketch snapshots / goldens ok; no snapshot changed 0
asap-devtools (includes planner_fuzz) 31 passed (devtools binary) 0
frontend-promql / frontend-metricsql ok 0

E6 x1 predicted costs, cost model 1, with |$Y| set to each config's LIMIT k. These are the predictions before the constants are recalibrated in #1555. In every config, the planner's full-intent plan keeps no lightcone at the configured |$Y|.

config (|$Y| of N) query at a time on demand full intent before (3ef265d): q-a-t / on demand / full
drill_cnt (10 of 10,000 hosts) 28.90 28.90 28.90 177.91 / 177.91 / 169.26 (lightcone)
drill_cnt, with Zipf(1) on host declared 35.49 35.49 35.49 not expressible
dash (10 of 500 services) 3.66 3.66 3.66 not measured on 3ef265d
rca (q2: all 500 services, bound by q1's HAVING; q3: 5 of 10,000 nodes) 129.76 129.76 129.76 not measured on 3ef265d

Lightcone break-even. For each |$Y|, the on-demand plan is compared with the plan forced onto the lightcone (no query-time scan may read the placeholder):

config on demand / forced lightcone, cost per second at |$Y| break-even |$Y|/N
drill_cnt 10: 28.90/89.03 · 100: 30.24/90.72 · 1,000: 43.66/102.93 · 3,000: 73.49/118.65 · 6,000: 118.23/140.38 · 9,000: 162.99/162.10 ≈ 8,900/10,000 ≈ 0.89 (interpolated between 6,000 and 9,000)
drill_cnt, Zipf(1) 10: 35.49/89.03 · 100: 41.73/90.72 · 1,000: 58.34/102.93 · 3,000: 86.23/118.65 · 6,000: 125.91/140.38 · 9,000: 164.96/162.10 ≈ 8,500/10,000 ≈ 0.85 (interpolated; the row share there is ≈ 0.98)
dash 10: 3.66/5.23 · 100: 14.66/5.28 · 250: 32.99/5.37 · 450: 57.44/5.49 ≈ 23/500 ≈ 0.05 (interpolated between 10 and 100)
rca forcing q3's lightcone leaves q1/q2 without a candidate (NoValidCandidate), so there is no lightcone plan to compare n/a (q2's binding is all 500 services, share 1)

The forced-lightcone cost does not change with the skew, because a filter over per-key states keeps the values' share, k/N. The skew raises only the on-demand side.

Follow-ups

  • Deferred:
    • Stage 0 value bounds from IN-lists (Q4).
    • Active groups per window under skew: calibration item 5 can read zipf_exponent_per_label.
    • A share for NOT IN.
    • Per-value frequencies beyond a Zipf exponent.
    • The rca lightcone: no lightcone candidate exists for q2's approximate p99 under the IN-list.
  • Executor: it must run a regrouping SummaryMerge over a Filter of chain windows. The planner selects this only when the lightcone pays (dash at |$Y| ≳ 25).
  • Draft issue on skew: section 8 of sil-inlist-selectivity.md in the private notes. The Zipf fact here supersedes it; it was not filed.

🤖 Generated with Claude Code

zzylol and others added 7 commits December 3, 2026 19:13
…n filter below the time merge

Test-first phase 3 of the IN-list selectivity plan (sil-inlist-selectivity):
cost unit tests U1-U16, group_count_bound tests T1-T4, asap_planner end-to-end
tests E1-E7 over drill_cnt x1 fixtures, SIL facade tests S1-S3, and Q5 tests
(Pass 2 offers Filter below the time merge; forced-lightcone cost; hole guard).

Signatures only, current behaviour kept: group_count_bound takes an unread
kept_values_per_column; DataFactAssumption::UniformRowsPerValue (never emitted
yet). New-behaviour tests fail on assertions; anchors pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
…d skew

A `Scan`'s predicates and a `Filter`'s keep their IN-lists' share of the
rows (`kept_share`): k of a column's N declared values keep k/N (rows per
value assumed uniform, warned as `UniformRowsPerValue`), or the heaviest k
values' Zipf mass H_k(s)/H_N(s) when the sources declare
`zipf_exponent_per_label` and the values stand for a SIL binding from an
upstream count-ranked top-k (`DataWorkload::heaviest_value_placeholders`,
added by the intent lowering). A query-time scan reads only the selected
rows (series selected by label); an ingestion-time scan sees every row.
`OutputFacts::kept_values_per_column` carries the restricted columns up;
groups and per-series counts use the kept share (`group_count_bound`), and
an ingestion-time grouping reads its input's rate. Stage 3's input
baseline keeps a column restricted by every candidate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
A `Filter` on a summary state group's keys gets the candidate
`SummaryMerge{group_by: keys}(Filter(p, W))`, `W` the chain windows the
group's window merge reads, so the merge reads only the kept keys' states
(drill_cnt's lightcone: 10 of 10,000 hosts' states, not 1,003,333).
Aggregate coverage derives for a key filter over a chain's windows, and a
regrouping merge maps keys past the windows' `window_end`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
- E2/Q5-E3/S2: the lightcone's chain build is the same for every |$Y|;
  the wider levels kept over it may differ (they trade off against the
  query-time merge, which now shrinks with |$Y|), so only the chain
  lines are compared, and the windows each filter reads may differ.
- Q5-E2: the selection finds a cheaper shape than the plan's estimate
  (one 10 s level filtered before the merge, 89.03/s): at most ~97/s.
- S1: q2's time range over the rows read grows 10x from |$Y| = 5 to 50;
  its scan's kept raw data and per-request cost do not scale.
- planner_fuzz (l): the numerator's label matcher keeps its share, so the
  plain graft may be the cheapest witness.
- New: E8 (heaviest bound hosts keep H_10/H_10000 under Zipf(1); literal
  hosts keep k/N) and the lowering marking a count-ranked binding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
… state

With one host bound, the compensation filter keeps 10 of the windows'
1,003,333 states, and the merge by the windows' keys counted its states per
group as rows / groups (10/1 vs 10.03), so it folded 60.14 rows a state
where the merge of all windows folds 60 and Stage 3's same-group check
failed. A regrouping merge keeping each window's groups now merges its
input's (exact) windows per group. The uniform rows-per-value warning
names the missing `zipf_exponent_per_label`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
…rows'

Under a declared skew the heaviest 10 of 10,000 hosts hold 0.2993 of the
rows but 10/10,000 of the per-key states (one per key and window). The
compensation filter over the lightcone's windows kept 0.2993 of the states,
so the merge by key folded ~18,000 rows a state against 60 for the merge of
all windows. `KeptShare::value_share` (k/N per column) is what a filter
over states keeps; a filter or scan over rows keeps `share`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
A key filter over states keeps the values' share of them; under a declared
skew each kept state then folds the rows' share over the values' share of
the average (0.2993 / 0.001 for the heaviest 10 of 10,000 hosts), as a
query-time build over the same selected rows does, so Stage 3's same-group
check holds (E6 drill_cnt with `zipf_exponent_per_label {host: 1.0}`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
@zzylol zzylol added enhancement New feature or request cost-model Cost formulas, statistics, ranking, and selection optimizer Workload optimization and plan selection workload Batch, repeating, or multi-query workload modeling labels Dec 3, 2026
…the executor

The Q5 shape the planner picks when the lightcone pays, a `Filter` on the
keys over a chain's windows read by a `SummaryMerge` by the chain's keys
(then merged by user), planned from SQL and run on the executor's data
plane: every view refreshed in ingestion runs, the query answered from the
windows, each user's count of the selected service's rows exact. The
executor already runs it (the merge groups by its keys whatever window a
state is from); this pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
@zzylol

zzylol commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up dae00dc: sql_table_scans::a_key_filter_over_chain_windows_regrouped_answers_exactly plans the Q5 lightcone shape from SQL (a key Filter over the chain's windows, read by a SummaryMerge by the chain's keys, then by user) and runs it on the executor's data plane (views refreshed in ingestion runs, the query answered from the windows): each user's count is exact. The executor already runs this shape (a regrouping merge groups by its keys whatever window a state comes from), so no executor change was needed; the Follow-ups line about executor support is resolved by this test. Verified on the remote build host: sql_table_scans:: 7 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cost-model Cost formulas, statistics, ranking, and selection enhancement New feature or request optimizer Workload optimization and plan selection workload Batch, repeating, or multi-query workload modeling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant