From 2e30b627debb51bba0a3733e9284af2c670638cc Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:18:49 +0000 Subject: [PATCH 1/8] feat(planner): Stage 2 materialization options and the latency check (Example 4) Stage 2 returns one physical candidate per materialization assignment of each logical candidate's summary builds (NotMaterialized, MatAtIngestion when eligible, MatAtQuery when two or more queries read the build). Counter states over continuously ingesting PromQL data are eligible, on the assumption that such data arrives in time order per series. Stage 3 prices a maintained pane chain as the newest pane's update and N + 1 kept panes, charges a MatAtQuery state only for the one evaluation it is held, and rejects a candidate whose query latency is over its ExplicitMaxMs bound. Candidates hold planning data only (id, origin, roots, DAG, the materialization assignment); asap_devtools::candidate_labels derives the viewer labels. MaterializationUnit is crate-private Stage 2 bookkeeping. --- .../asap-aware-mapping/src/analytical_cost.rs | 10 + .../src/pass/stage1_to_stage3.rs | 187 +- .../src/physical_plan_cost_model.rs | 8 + .../src/stage2_physical_asap_optimization.rs | 866 +- .../src/stage3_plan_selection.rs | 553 +- crates/asap-aware-mapping/src/test_support.rs | 2 +- .../src/physical_planner/candidates.rs | 2 +- .../tests/common/mod.rs | 2 +- crates/devtools/src/bin/stage_pipeline.rs | 37 +- crates/devtools/src/candidate_labels.rs | 266 + crates/devtools/src/lib.rs | 4 +- crates/devtools/src/planning_stages.rs | 57 +- crates/devtools/tests/stage_pipeline.rs | 35 +- crates/frontend-promql/tests/support.rs | 4 +- crates/frontend-sql/tests/pearson_corr.rs | 2 +- crates/integration-tests/src/lib.rs | 2 +- .../tests/operator_design_examples.rs | 45 +- .../tests/planner_layering_common/mod.rs | 108 +- .../tests/planner_layering_example1.rs | 87 +- .../tests/planner_layering_example2.rs | 11 +- .../tests/planner_layering_example4.rs | 41 +- .../stage2_physical_asap_optimization_sql.rs | 10 +- .../tests/tumbling_pane_merge.rs | 40 +- crates/planner/tests/e2e_plan.rs | 2 +- crates/planner/tests/plan_stages.rs | 2 +- crates/planner/tests/summary_sharing.rs | 2 +- crates/types/src/ir/mod.rs | 4 +- crates/types/src/ir/pane_chain.rs | 37 +- crates/types/src/ir/timing.rs | 212 +- .../src/post_asap/execution_data_state.rs | 6 + crates/types/src/workload.rs | 45 + crates/types/tests/pane_chain.rs | 42 + .../planner-layering-example4-acceptance.md | 57 +- docs/user_guide_docs/stage-viewer.md | 4 +- .../examples/planner-layering-example1.json | 53995 ++++++++++++++-- 35 files changed, 51686 insertions(+), 5101 deletions(-) create mode 100644 crates/devtools/src/candidate_labels.rs diff --git a/crates/asap-aware-mapping/src/analytical_cost.rs b/crates/asap-aware-mapping/src/analytical_cost.rs index ed05154d1..999258183 100644 --- a/crates/asap-aware-mapping/src/analytical_cost.rs +++ b/crates/asap-aware-mapping/src/analytical_cost.rs @@ -165,6 +165,14 @@ pub struct ResourceCalibration { pub cost_per_retained_byte_second: f64, #[serde(default = "default_horizon_s")] pub horizon_s: f64, + /// Milliseconds one CPU operation takes on one core: plan selection's + /// latency check reads it (0: work takes no time). + #[serde(default)] + pub ms_per_cpu_op: f64, + /// Milliseconds scanning one byte takes on one core, for the latency + /// check. + #[serde(default)] + pub ms_per_scan_byte: f64, pub version: String, } @@ -185,6 +193,8 @@ impl ResourceCalibration { "cost_per_retained_byte_second", self.cost_per_retained_byte_second, ), + ("ms_per_cpu_op", self.ms_per_cpu_op), + ("ms_per_scan_byte", self.ms_per_scan_byte), ] { if !value.is_finite() || value < 0.0 { return Err(AnalyticalCostError::InvalidCalibration(name, value)); diff --git a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs index e896189ab..6fec9309a 100644 --- a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs +++ b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs @@ -26,7 +26,8 @@ //! candidates; every distinct candidate once; the independent candidate //! is kept; //! 2. Stage 2, physical ASAP-aware optimization of every Stage 1 candidate -//! ([`optimize_physical_asap`]); +//! ([`optimize_physical_asap`]): one physical candidate per +//! materialization assignment of its summary builds; //! 3. Stage 3, plan selection over the physical candidates ([`select_plan`]). //! //! Stage 0, the query-language frontends, runs before it (the `asap-planner` @@ -45,7 +46,9 @@ use asap_types::ir::schema_support::with_promql_series_identity; use asap_types::ir::{ASAPOp, OperatorNode, QueryRoot}; use asap_types::post_asap::{FieldDataType, SketchAlgorithm}; use asap_types::types::AccuracyTarget; -use asap_types::workload::{DataWorkload, QueryLanguage, QueryRecurrence, RepeatedDemand}; +use asap_types::workload::{ + DataWorkload, QueryDemand, QueryLanguage, QueryRecurrence, RepeatedDemand, +}; use super::{OptimizationInput, OptimizationPass, OptimizeError, PlanOutput, QueryPlan}; use crate::asap_aware_cse::{ @@ -54,8 +57,8 @@ use crate::asap_aware_cse::{ window_composition_variants, MAX_REUSE_SITES, }; use crate::per_computation_candidates::{ - compose_logical_candidate, generate_per_computation_candidates, ComputationCandidate, - PerComputationCandidateError, PerComputationCandidates, + compose_logical_candidate, generate_per_computation_candidates, PerComputationCandidateError, + PerComputationCandidates, }; use crate::stage2_physical_asap_optimization::{optimize_physical_asap, PhysicalCandidate}; use crate::stage3_plan_selection::{select_plan, Selection, SelectionError}; @@ -68,9 +71,6 @@ use crate::PlanningModels; pub struct LogicalCandidate { /// `L`, numbered in enumeration order. pub id: String, - /// Human-readable name of the candidate, e.g. "Q1 exact · Q2 CMS+heap", used only for - /// display. - pub display_name: String, pub choice: Vec, pub roots: Result, PerComputationCandidateError>, } @@ -100,9 +100,6 @@ pub struct Pass2Candidate { #[derive(Debug, Clone, PartialEq)] pub struct PrunedCandidate { pub from_logical: String, - /// Human-readable name of the candidate, e.g. "Q1 exact · Q2 CMS+heap", used only for - /// display. - pub display_name: String, pub reason: String, } @@ -124,8 +121,9 @@ pub struct Stage1ToStage3Run { /// order: each composed Pass 1 candidate, followed by its Pass 2 /// candidates. pub stage1_logical_asap_optimization: Vec, - /// Stage 2: one physical candidate (`P` from `L`) per Stage 1 - /// candidate that composed and was implemented. + /// Stage 2: the physical candidates of each Stage 1 candidate that + /// composed and was implemented, one per materialization assignment: + /// `P` (nothing materialized), then `P-m`, from `L`. pub stage2_physical_asap_optimization: Vec, /// Stage 2: the Stage 1 candidates Stage 2 could not implement, with the /// reasons. @@ -157,13 +155,14 @@ impl Stage1ToStage3Run { /// Run Stage 1 → Stage 2 → Stage 3 over the frontends' `roots`, enumerating every /// whole-workload candidate. `targets[i]` is the accuracy -/// requirement of `roots[i]` (`None` imposes none). Only a Pass 1 failure is +/// requirement of `roots[i]` (`None` imposes none) and `demand[i]` how it is +/// demanded (recurrence, predictability, latency bound). Only a Pass 1 failure is /// an error; a candidate that does not compose or cannot be implemented is /// listed with its reason, and a failed selection is reported in the run. pub fn run_stage1_to_stage3( roots: Vec<(Id, QueryRoot)>, targets: &[Option], - recurrence: &[QueryRecurrence], + demand: &[QueryDemand], data: &DataWorkload, models: PlanningModels<'_>, ) -> Result, PerComputationCandidateError> { @@ -171,7 +170,7 @@ pub fn run_stage1_to_stage3( Ok(run_stage1_to_stage3_from_pass1( per_computation, targets, - recurrence, + demand, data, models, )) @@ -180,8 +179,6 @@ pub fn run_stage1_to_stage3( /// One Stage 1 candidate in enumeration order, before Stage 2 numbers it. #[derive(Debug)] pub struct Stage1Candidate { - /// Human-readable name, used only for display. - pub display_name: String, /// The Pass 1 choice (`targets[t].choices.candidates[choice[t]]`); a /// Pass 2 candidate has its Pass 1 candidate's. pub choice: Vec, @@ -225,7 +222,6 @@ pub fn stage1_logical_asap_optimization<'a, Id: Clone>( recurrence: &[QueryRecurrence], ) -> impl Iterator + 'a { let interval_ms: Vec> = recurrence.iter().map(fixed_interval_ms).collect(); - let query_of_target = query_of_target(per_computation); let mut choice = Some(vec![0; per_computation.targets.len()]); let mut queue = std::collections::VecDeque::new(); let mut position = 0usize; @@ -240,7 +236,6 @@ pub fn stage1_logical_asap_optimization<'a, Id: Clone>( if skip { continue; } - let display_name = display_name(per_computation, &query_of_target, &this); let roots = compose_logical_candidate(per_computation, &this) .map(|roots| roots.into_iter().map(|(_, root)| root).collect::>()); let from = position + queue.len(); @@ -249,7 +244,6 @@ pub fn stage1_logical_asap_optimization<'a, Id: Clone>( Err(_) => Vec::new(), }; queue.push_back(Stage1Candidate { - display_name: display_name.clone(), choice: this.clone(), roots, pass2_of: None, @@ -265,21 +259,7 @@ pub fn stage1_logical_asap_optimization<'a, Id: Clone>( roots, } in pass2 { - let mut name = display_name.clone(); - if !summaries.is_empty() { - name += &format!(" · one {}", summaries.join(", one ")); - } - if !panes.is_empty() { - name += &format!(" · {}", panes.join(", ")); - } - if !reused.is_empty() { - name += &format!(" · {}", reused.join(", ")); - } - if !shared.is_empty() { - name += &format!(" · shared {}", shared.join(", ")); - } queue.push_back(Stage1Candidate { - display_name: name, choice: this.clone(), roots, pass2_of: Some(Pass2Of { @@ -597,6 +577,15 @@ fn state_name(build: &OperatorNode) -> String { } } +/// A sketch algorithm's name, e.g. "CMS+heap" or "Kll". +fn sketch_name(algorithm: &SketchAlgorithm) -> String { + match algorithm { + SketchAlgorithm::CmsWithHeap => "CMS+heap".to_string(), + SketchAlgorithm::CountSketchWithHeap => "CountSketch+heap".to_string(), + other => format!("{other:?}"), + } +} + /// `ms` in the largest whole unit: "1m", "10s", "250ms". fn duration_name(ms: u64) -> String { match ms { @@ -632,22 +621,25 @@ fn readers_of(roots: &[QueryRoot], node: &Rc) -> Vec { pub fn run_stage1_to_stage3_from_pass1( per_computation: PerComputationCandidates, targets: &[Option], - recurrence: &[QueryRecurrence], + demand: &[QueryDemand], data: &DataWorkload, models: PlanningModels<'_>, ) -> Stage1ToStage3Run { - let stage1 = stage1_logical_asap_optimization(&per_computation, recurrence).collect(); - run_stage2_and_stage3(per_computation, stage1, targets, recurrence, data, models) + let recurrence: Vec<_> = demand.iter().map(|d| d.recurrence.clone()).collect(); + let stage1 = stage1_logical_asap_optimization(&per_computation, &recurrence).collect(); + run_stage2_and_stage3(per_computation, stage1, targets, demand, data, models) } /// Stage 2 and Stage 3 over `stage1`, the Stage 1 candidates of /// `per_computation` in enumeration order (all of them, or the ones a caller -/// enumerated): candidate `n` (from 1) is `L`, implemented as `P`. +/// enumerated): candidate `n` (from 1) is `L`, implemented as `P` +/// with nothing materialized and as `P-m` (`k` from 1) for each other +/// materialization assignment. pub fn run_stage2_and_stage3( per_computation: PerComputationCandidates, stage1: Vec, targets: &[Option], - recurrence: &[QueryRecurrence], + demand: &[QueryDemand], data: &DataWorkload, models: PlanningModels<'_>, ) -> Stage1ToStage3Run { @@ -660,15 +652,18 @@ pub fn run_stage2_and_stage3( let number = index + 1; let id = format!("L{number}"); if let Ok(roots) = &candidate.roots { - match optimize_physical_asap(&id, roots) { - Ok(mut implemented) => { - implemented.id = format!("P{number}"); - implemented.display_name = candidate.display_name.clone(); - physical.push(implemented); + match optimize_physical_asap(&id, roots, demand, data) { + Ok(implemented) => { + for (k, mut p) in implemented.into_iter().enumerate() { + p.id = match k { + 0 => format!("P{number}"), + k => format!("P{number}-m{k}"), + }; + physical.push(p); + } } Err(error) => pruned.push(PrunedCandidate { from_logical: id.clone(), - display_name: candidate.display_name.clone(), reason: error.to_string(), }), } @@ -685,12 +680,11 @@ pub fn run_stage2_and_stage3( } logical.push(LogicalCandidate { id, - display_name: candidate.display_name, choice: candidate.choice, roots: candidate.roots, }); } - let selection = select_plan(&physical, targets, recurrence, data, models); + let selection = select_plan(&physical, targets, demand, data, models); let selected_logical = selection.as_ref().ok().and_then(|selection| { let from = &physical .iter() @@ -733,29 +727,6 @@ fn next_choice(inventory: &PerComputationCandidates, choice: &mut [usize false } -/// `query_of_target[t]`: the index of the query root that first reads target -/// `t` (the first root, in input order, from which the target is reachable). -/// [`display_name`] lists each target's choice under that query. -fn query_of_target(inventory: &PerComputationCandidates) -> Vec { - inventory - .targets - .iter() - .map(|target| { - inventory - .roots - .iter() - .position(|(_, root)| { - root_operators(root).into_iter().any(|node| { - OperatorNode::reachable(node) - .iter() - .any(|n| Rc::ptr_eq(n, &target.target)) - }) - }) - .expect("every target is reached from a root") - }) - .collect() -} - fn root_operators(root: &QueryRoot) -> Vec<&Rc> { match root { QueryRoot::Operator(node) => vec![node], @@ -763,76 +734,6 @@ fn root_operators(root: &QueryRoot) -> Vec<&Rc> { } } -/// A human-readable name of a candidate, e.g. "Q1 exact · Q2 CMS+heap" -/// (exact accumulators are listed in parentheses), used only for display in -/// the `stage_pipeline` devtool and the viewer; planning never reads it. -fn display_name( - inventory: &PerComputationCandidates, - query_of_target: &[usize], - choice: &[usize], -) -> String { - // Targets a chosen whole-expression candidate absorbs are not computed. - let absorbed: Vec = inventory - .targets - .iter() - .zip(choice) - .filter(|(target, &index)| target.choices.candidates[index].absorbs_inner()) - .filter_map(|(target, _)| target.absorbs) - .collect(); - (0..inventory.roots.len()) - .map(|query| { - let mut sketches = Vec::new(); - let mut accumulators = Vec::new(); - for (t, (target, (&target_query, &index))) in inventory - .targets - .iter() - .zip(query_of_target.iter().zip(choice)) - .enumerate() - { - if target_query != query || absorbed.contains(&t) { - continue; - } - match &target.choices.candidates[index] { - ComputationCandidate::Exact => {} - ComputationCandidate::ExactAccumulator { kind, .. } => { - accumulators.push(format!("{kind:?} acc")) - } - ComputationCandidate::AvgAsSumCount => { - accumulators.push("Sum/Count acc".into()) - } - ComputationCandidate::NestedSumMerge => { - accumulators.push("nested Sum acc".into()) - } - ComputationCandidate::Summary(algorithm) - | ComputationCandidate::WholeExpression(algorithm) => { - sketches.push(sketch_name(algorithm)) - } - } - } - let mut text = format!("Q{} ", query + 1); - text += &if sketches.is_empty() { - "exact".to_string() - } else { - sketches.join(" + ") - }; - if !accumulators.is_empty() { - text += &format!(" ({})", accumulators.join(", ")); - } - text - }) - .collect::>() - .join(" · ") -} - -/// A sketch algorithm's display name, e.g. "CMS+heap" or "Kll". -fn sketch_name(algorithm: &SketchAlgorithm) -> String { - match algorithm { - SketchAlgorithm::CmsWithHeap => "CMS+heap".to_string(), - SketchAlgorithm::CountSketchWithHeap => "CountSketch+heap".to_string(), - other => format!("{other:?}"), - } -} - /// The planner pipeline behind the optimization-pass interface: the /// workload's roots in entry order, PromQL roots with each series' full /// identity as a column (the row representation per-series state needs at @@ -875,13 +776,13 @@ impl OptimizationPass for Stage1ToStage3Pass { .entries() .map(|entry| Some(entry.requirements.accuracy.requested())) .collect(); - let recurrence: Vec<_> = workload + let demand: Vec<_> = workload .query_workload() .entries() - .map(|entry| entry.recurrence) + .map(|entry| QueryDemand::from(&entry)) .collect(); let data = workload.data_workload().cloned().unwrap_or_default(); - let run = run_stage1_to_stage3(roots, &targets, &recurrence, &data, input.models)?; + let run = run_stage1_to_stage3(roots, &targets, &demand, &data, input.models)?; let selection = run.stage3_plan_selection?; let roots = selection.plan.clone(); let mut output = PlanOutput::new(Vec::new()); diff --git a/crates/asap-aware-mapping/src/physical_plan_cost_model.rs b/crates/asap-aware-mapping/src/physical_plan_cost_model.rs index 670f77882..1eb960eab 100644 --- a/crates/asap-aware-mapping/src/physical_plan_cost_model.rs +++ b/crates/asap-aware-mapping/src/physical_plan_cost_model.rs @@ -604,6 +604,8 @@ mod tests { cost_per_retained_byte: 1.0, cost_per_retained_byte_second: 0.0, horizon_s: crate::analytical_cost::DEFAULT_HORIZON_S, + ms_per_cpu_op: 0.0, + ms_per_scan_byte: 0.0, version: "test-v1".into(), } } @@ -692,6 +694,8 @@ mod tests { cost_per_retained_byte: 0.0, cost_per_retained_byte_second: 0.0, horizon_s: crate::analytical_cost::DEFAULT_HORIZON_S, + ms_per_cpu_op: 0.0, + ms_per_scan_byte: 0.0, version: "unused-base-v1".into(), }; let candidates = @@ -821,6 +825,8 @@ mod tests { cost_per_retained_byte: 0.0, cost_per_retained_byte_second: 0.0, horizon_s: crate::analytical_cost::DEFAULT_HORIZON_S, + ms_per_cpu_op: 0.0, + ms_per_scan_byte: 0.0, version: "handoff-only-v1".into(), }; let space = crate::replacement::search_workload_with( @@ -945,6 +951,8 @@ mod tests { cost_per_retained_byte: 0.0, cost_per_retained_byte_second: 0.0, horizon_s: crate::analytical_cost::DEFAULT_HORIZON_S, + ms_per_cpu_op: 0.0, + ms_per_scan_byte: 0.0, version: "disk-only-v1".into(), }, ) diff --git a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs index 37edf877c..b6ae276b0 100644 --- a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs +++ b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs @@ -1,13 +1,47 @@ -//! #509 Stage 2, physical ASAP-aware optimization (MVP): turns one +//! #509 Stage 2, physical ASAP-aware optimization: turns one //! CandidateLogicalASAPDAG into CandidatePhysicalASAPDAGs by materialization -//! and physical operator implementation. Materialization offers one option -//! for now: every sub-DAG is `Materialization::NotMaterialized` and runs at -//! query time, so each logical candidate yields exactly one physical -//! candidate. Enumerating -//! `MatAtIngestion(medium)` and `MatAtQuery(medium)` per sub-DAG -//! (Algorithm 3) comes in #604. A candidate this stage cannot implement -//! fails with a [`PhysicalASAPOptimizationError`], and the caller prunes that candidate alone, -//! with the error as its reason. +//! and physical operator implementation. +//! +//! ## Materialization +//! +//! Each summary build (a `SummaryAgg` or a `PaneChain`) is one unit whose +//! output materialization may store (#509 §Materialization, Algorithm 3). +//! Each unit has up to three options: +//! +//! * `NotMaterialized`: rebuilt at query time by every query that reads it; +//! * `MatAtIngestion(Memory)`: maintained as data arrives and kept for the +//! queries, when the unit is eligible ([`IngestionPruneReason`]); +//! * `MatAtQuery(Memory)`: built once per evaluation for every query that +//! reads it, offered for a unit two or more queries read. State is reused +//! only within one evaluation; keeping it across evaluations comes later. +//! +//! A unit at ingestion time needs every unit below it at ingestion time too +//! (#509 Algorithm 3, line 13); such assignments are not generated. Every +//! other combination of options is one physical candidate, the +//! all-`NotMaterialized` one first: nothing is capped. A node that one +//! query reads at ingestion time and another at query time is copied, one +//! copy per phase ([`split_shared_by_phase`]). +//! +//! A unit may run at ingestion time (S4) only when: +//! +//! * the data workload is continuously ingesting or mixed (unknown arrival +//! counts as not ingesting); +//! * every query reading it repeats and is predictable; +//! * it has no filter: an ingestion-time build reads raw samples, which +//! carry none of the columns a filter reads; +//! * if it is a counter state (`Rate`, `Increase`, `IRate`), whose update +//! needs each series' samples in time order, the data is continuously +//! ingesting and every source below it is a time series. Assumption: +//! continuously ingesting PromQL data arrives in time order per series, +//! as Prometheus assumes (it rejects out-of-order samples). Table (SQL) +//! sources and mixed data, whose at-rest part may load in any order, are +//! not taken to be ordered; +//! * it is a tumbling-pane chain, or a whole-window build whose readers +//! all run at one fixed interval with a known phase, over a window no +//! longer than that interval and not shifted; +//! * everything below it can run at ingestion time. +//! +//! ## Physical operator implementation //! //! The runtime has one implementation per logical operator except exact //! top-k, which it cannot run as `Aggregate{[TopK]}`. Stage 2 records that @@ -21,38 +55,60 @@ //! not make it the same answer. //! An `Aggregate{[TopK]}` over a per-entity reduction, or with other //! measures, a filter or `HAVING`, has no such rewrite, and its candidate -//! fails. +//! fails with a [`PhysicalASAPOptimizationError`]; the caller prunes that +//! candidate alone, with the error as its reason. //! A summary needs no rewrite: `SummaryAgg` → `SummaryEstimate` already is //! build → estimate. Every node keeps the guarantee Stage 1 composed for it. -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; use std::rc::Rc; +use asap_types::ir::operator_properties::Source; use asap_types::ir::physical_export::{ - compile_physical_asap_workload_with_node_ids, PhysicalASAPDAG, + compile_physical_asap_workload_with_node_ids, PhysicalASAPDAG, PhysicalASAPNodeId, }; use asap_types::ir::{ - apply_materialization_timings, MaterializationAssignment, NonASAPOp, Operator, OperatorNode, - ProjectItem, QueryRoot, ScalarExpr, SchemaDerivationError, SortKey, TimingMemo, + apply_materialization_timings, is_filtered_build, split_shared_by_phase, ASAPOp, + MaterializationAssignment, Medium, NonASAPOp, Operator, OperatorNode, ProjectItem, QueryRoot, + ScalarExpr, SchemaDerivationError, SortKey, TimingMemo, +}; +use asap_types::post_asap::{ + ExactKind, ExecutionDataStateError, ExecutionTiming, FieldDataType, Materialization, }; -use asap_types::post_asap::{ExecutionDataStateError, Materialization}; use asap_types::pre_asap::column_resolution::resolve_column_ref; use asap_types::pre_asap::expr_ir::ColumnRef; use asap_types::pre_asap::{AggIntent, Reduction}; +use asap_types::workload::{ + DataArrival, DataWorkload, Predictability, QueryDemand, QueryRecurrence, RepeatedDemand, +}; use thiserror::Error; /// One CandidatePhysicalASAPDAG (Stage 2 output), derived from exactly one -/// CandidateLogicalASAPDAG (Stage 1 output). -/// `roots` are the timed query roots (one per query, in workload order) -/// that `dag` exports. +/// CandidateLogicalASAPDAG (Stage 1 output). It holds planning data only; +/// display labels are derived from it by the devtools. #[derive(Debug, Clone)] pub struct PhysicalCandidate { + /// `P` (nothing materialized) or `P-m`, set by the caller. pub id: String, + /// The id of the logical candidate it implements. pub from_logical: String, - /// Human-readable name of the candidate, used only for display (see - /// `pass::stage1_to_stage3`). - pub display_name: String, + /// The timed query roots, one per query in workload order, that `dag` + /// exports. pub roots: Vec, pub dag: PhysicalASAPDAG, + /// Its materialization assignment: the option chosen for each summary + /// build (`SummaryAgg` or `PaneChain`) of `dag`, by node id, including + /// the builds left `NotMaterialized`. A build one query reads at + /// ingestion time and another at query time appears once per copy. + pub materialization: BTreeMap, +} + +impl PhysicalCandidate { + /// Whether any summary build is materialized. + pub fn materializes_any(&self) -> bool { + self.materialization + .values() + .any(|m| *m != Materialization::NotMaterialized) + } } #[derive(Debug, Error)] @@ -65,33 +121,365 @@ pub enum PhysicalASAPOptimizationError { ExactTopK(String), } +/// Why a summary build cannot be materialized at ingestion time (S4). +/// Stage 2 bookkeeping, like [`MaterializationUnit`]. +#[derive(Debug, Clone, PartialEq, Eq)] +pub(crate) enum IngestionPruneReason { + /// The data workload is at rest, or its arrival is unknown. + NotIngesting, + /// A query reading it is not repeated. + NotRepeated, + /// A query reading it is not predictable. + NotPredictable, + /// It has a filter, which only a query-time build can apply. + Filtered, + /// It is a counter state, whose update needs each series' samples in + /// time order, over data not taken to arrive in that order: only + /// continuously ingesting time-series (PromQL) sources are. + CounterNeedsTimeOrder, + /// A whole-window build whose readers do not all run at one fixed + /// interval with a known phase, or whose window is longer than that + /// interval, shifted, or not a range. + WindowNotFixed, + /// Something below it can only run at query time. + UpstreamAtQueryTime(String), +} + +/// Stage 2's enumeration bookkeeping: one summary build Stage 2 may decide +/// to store, with the options it has. For example, over one metric: +/// +/// ```text +/// q1: quantile_over_time(0.99, latency[5m]) every 1m +/// q2: max_over_time(latency[5m]) every 1m +/// ``` +/// +/// If Stage 1 chose KLL panes for q1 and exact max panes for q2, Stage 2 +/// finds two units: +/// +/// | unit | readers | options | +/// |-------------------|---------|----------------------------------| +/// | Kll ×5 panes (q1) | q1 | NotMaterialized, MatAtIngestion | +/// | Max acc ×5 panes | q2 | NotMaterialized, MatAtIngestion | +/// +/// A unit read by two or more queries also gets `MatAtQuery` (built once +/// per evaluation and reused). The physical candidates are the product of +/// the units' options, here 2 × 2 = 4, less the assignments that put a +/// unit at ingestion time over one that is not; Stage 3 prices each. +/// `at_ingestion` records why ingestion is ruled out when it is (e.g. +/// `Filtered`, `NotRepeated`). The result each candidate carries is its +/// assignment ([`PhysicalCandidate::materialization`]). +#[derive(Debug, Clone)] +pub(crate) struct MaterializationUnit { + /// The build in the implemented DAG. + pub(crate) node: Rc, + /// The queries (indices into the roots) that read it. + pub(crate) readers: Vec, + /// `Ok` when `MatAtIngestion` is an option. + pub(crate) at_ingestion: Result<(), IngestionPruneReason>, +} + +impl MaterializationUnit { + /// Its options, `NotMaterialized` first: `MatAtIngestion` when eligible, + /// `MatAtQuery` when two or more queries read it. + pub(crate) fn options(&self) -> Vec { + let mut options = vec![Materialization::NotMaterialized]; + if self.at_ingestion.is_ok() { + options.push(Materialization::MatAtIngestion(Medium::Memory)); + } + if self.readers.len() > 1 { + options.push(Materialization::MatAtQuery(Medium::Memory)); + } + options + } +} + /// Stage 2 for one CandidateLogicalASAPDAG: implement every operator -/// (physical operator implementation) and time it with every -/// sub-DAG `NotMaterialized`. `id` and `display_name` are left empty for the caller -/// to name. Sharing between `roots` is preserved: one memo serves the whole +/// (physical operator implementation), then one physical candidate per +/// materialization assignment of its units, the all-`NotMaterialized` one +/// first. `demand[i]` is how query `i` (`roots[i]`) is demanded; a missing +/// entry is unknown. `id` is left empty for the caller to name. Sharing between `roots` is preserved: one memo serves the whole /// workload. pub fn optimize_physical_asap( from_logical: &str, roots: &[QueryRoot], -) -> Result { + demand: &[QueryDemand], + data: &DataWorkload, +) -> Result, PhysicalASAPOptimizationError> { let mut memo = HashMap::new(); let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; - let assignment = MaterializationAssignment::with_default(Materialization::NotMaterialized); - let mut timing = TimingMemo::new(); - let timed = map_roots(&implemented, &mut |node| { - Ok(apply_materialization_timings( - node, - &assignment, - &mut timing, - )?) - })?; - let dag = compile_physical_asap_workload_with_node_ids(&timed)?.dag; - Ok(PhysicalCandidate { - id: String::new(), - from_logical: from_logical.to_string(), - display_name: String::new(), - roots: timed, - dag, + let units = materialization_units(&implemented, demand, data); + let mut candidates = Vec::new(); + for assignment in materialization_assignments(&units) { + let materialized: Vec<_> = units + .iter() + .zip(&assignment) + .filter(|(_, m)| **m != Materialization::NotMaterialized) + .map(|(unit, m)| (unit, *m)) + .collect(); + let mut options = MaterializationAssignment::with_default(Materialization::NotMaterialized); + for (unit, materialization) in &materialized { + options.set(&unit.node, *materialization); + } + let operators: Vec> = implemented + .iter() + .flat_map(|root| root_operators(root).into_iter().cloned()) + .collect(); + let (split, options) = split_shared_by_phase(&operators, &options); + let replaced: HashMap<_, _> = operators + .iter() + .map(Rc::as_ptr) + .zip(split.iter().cloned()) + .collect(); + let split_roots = map_roots(&implemented, &mut |node| { + Ok(replaced[&Rc::as_ptr(node)].clone()) + })?; + let mut timing = TimingMemo::new(); + let timed = map_roots(&split_roots, &mut |node| { + Ok(apply_materialization_timings(node, &options, &mut timing)?) + })?; + let dag = compile_physical_asap_workload_with_node_ids(&timed)?.dag; + let materialization = dag + .nodes + .iter() + .filter(|n| { + matches!( + n.payload, + Operator::ASAP(ASAPOp::SummaryAgg { .. } | ASAPOp::PaneChain { .. }) + ) + }) + .map(|n| (n.id, n.materialization)) + .collect(); + candidates.push(PhysicalCandidate { + id: String::new(), + from_logical: from_logical.to_string(), + roots: timed, + dag, + materialization, + }); + } + Ok(candidates) +} + +/// The number of physical candidates [`optimize_physical_asap`] returns for +/// `roots`, without building them; `Err` when a candidate cannot be +/// implemented. +pub fn physical_candidate_count( + roots: &[QueryRoot], + demand: &[QueryDemand], + data: &DataWorkload, +) -> Result { + let mut memo = HashMap::new(); + let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; + Ok(materialization_assignments(&materialization_units(&implemented, demand, data)).count()) +} + +/// The operator nodes `root` reads. +fn root_operators(root: &QueryRoot) -> Vec<&Rc> { + match root { + QueryRoot::Operator(node) => vec![node], + QueryRoot::Scalar(expr) => expr.operator_refs(), + } +} + +/// Every summary build of `roots` (implemented), in discovery order, with +/// its readers and whether it may run at ingestion time. +pub(crate) fn materialization_units( + roots: &[QueryRoot], + demand: &[QueryDemand], + data: &DataWorkload, +) -> Vec { + let mut nodes: Vec> = Vec::new(); + let mut readers: HashMap<*const OperatorNode, Vec> = HashMap::new(); + for (query, root) in roots.iter().enumerate() { + for operator in root_operators(root) { + for node in OperatorNode::reachable(operator) { + if !matches!( + node.asap(), + Some(ASAPOp::SummaryAgg { .. } | ASAPOp::PaneChain { .. }) + ) { + continue; + } + let entry = readers.entry(Rc::as_ptr(&node)).or_default(); + if entry.is_empty() { + nodes.push(Rc::clone(&node)); + } + if !entry.contains(&query) { + entry.push(query); + } + } + } + } + let below = units_below(&nodes); + nodes + .iter() + .enumerate() + .map(|(u, node)| { + let readers = readers[&Rc::as_ptr(node)].clone(); + let at_ingestion = ingestion_eligibility(node, &readers, demand, data).and_then(|()| { + // Only this unit and the units below it at ingestion time. + let mut trial = + MaterializationAssignment::with_default(Materialization::NotMaterialized); + for &v in below[u].iter().chain([&u]) { + trial.set(&nodes[v], Materialization::MatAtIngestion(Medium::Memory)); + } + apply_materialization_timings(node, &trial, &mut TimingMemo::new()) + .map(|_| ()) + .map_err(|e| IngestionPruneReason::UpstreamAtQueryTime(e.to_string())) + }); + MaterializationUnit { + node: Rc::clone(node), + readers, + at_ingestion, + } + }) + .collect() +} + +/// Whether every scan below `node` reads a time series (a PromQL source). +fn reads_only_time_series(node: &OperatorNode) -> bool { + match node.non_asap() { + Some(NonASAPOp::Scan { source, .. }) => matches!(source, Source::TimeSeries { .. }), + _ => node.children().iter().all(|c| reads_only_time_series(c)), + } +} + +/// The workload rules of S4 for `node` (module doc). +fn ingestion_eligibility( + node: &OperatorNode, + readers: &[usize], + demand: &[QueryDemand], + data: &DataWorkload, +) -> Result<(), IngestionPruneReason> { + use IngestionPruneReason as Why; + if !matches!( + data.arrival, + DataArrival::ContinuouslyIngesting | DataArrival::Mixed + ) { + return Err(Why::NotIngesting); + } + let demands: Vec> = readers.iter().map(|&q| demand.get(q)).collect(); + if demands + .iter() + .any(|d| !d.is_some_and(|d| matches!(d.recurrence, QueryRecurrence::Repeated(_)))) + { + return Err(Why::NotRepeated); + } + if demands + .iter() + .any(|d| !d.is_some_and(|d| matches!(d.predictability, Predictability::Predictable { .. }))) + { + return Err(Why::NotPredictable); + } + if is_filtered_build(node) { + return Err(Why::Filtered); + } + let (family, chain) = match node.asap() { + Some(ASAPOp::SummaryAgg { family, .. }) => (family, false), + Some(ASAPOp::PaneChain { family, .. }) => (family, true), + _ => unreachable!("a unit is a summary build"), + }; + if matches!( + family, + FieldDataType::ExactAggregate(ExactKind::Rate | ExactKind::Increase | ExactKind::IRate, _) + ) { + // Assumption (module doc): continuously ingesting PromQL data + // arrives in time order per series, as Prometheus assumes. + let ordered = + data.arrival == DataArrival::ContinuouslyIngesting && reads_only_time_series(node); + if !ordered { + return Err(Why::CounterNeedsTimeOrder); + } + } + if chain { + return Ok(()); + } + // A whole-window build: one window per evaluation, at one known phase, + // that ends at the evaluation and fits in the interval. + let mut cadence = None; + for d in demands.into_iter().flatten() { + let QueryRecurrence::Repeated(RepeatedDemand::FixedIntervalAt { + interval, + evaluation_phase, + }) = &d.recurrence + else { + return Err(Why::WindowNotFixed); + }; + if cadence.is_some_and(|c| c != (interval.0, evaluation_phase.0)) { + return Err(Why::WindowNotFixed); + } + cadence = Some((interval.0, evaluation_phase.0)); + } + let Some((interval_ms, _)) = cadence else { + return Err(Why::WindowNotFixed); + }; + match node.children()[0].non_asap() { + Some(NonASAPOp::TimeRange { + range, + kind: asap_types::ir::TimeRangeKind::Range, + child, + }) if range.as_millis() <= u128::from(interval_ms) + && !matches!(child.non_asap(), Some(NonASAPOp::TimeShift { .. })) => + { + Ok(()) + } + _ => Err(Why::WindowNotFixed), + } +} + +/// For each of `nodes`, the indices of the others below it. +fn units_below(nodes: &[Rc]) -> Vec> { + nodes + .iter() + .map(|node| { + let reachable = OperatorNode::reachable(node); + (0..nodes.len()) + .filter(|&v| { + !Rc::ptr_eq(&nodes[v], node) + && reachable.iter().any(|n| Rc::ptr_eq(n, &nodes[v])) + }) + .collect() + }) + .collect() +} + +/// Every assignment of an option to each unit (mixed radix, the last unit +/// varying fastest, all `NotMaterialized` first) in which every unit below +/// an ingestion-time unit is at ingestion time too. +fn materialization_assignments( + units: &[MaterializationUnit], +) -> impl Iterator> + '_ { + let options: Vec> = units.iter().map(|u| u.options()).collect(); + let nodes: Vec<_> = units.iter().map(|u| Rc::clone(&u.node)).collect(); + let below = units_below(&nodes); + let mut digits = Some(vec![0usize; units.len()]); + std::iter::from_fn(move || loop { + let current = digits.as_mut()?; + let assignment: Vec = current + .iter() + .zip(&options) + .map(|(&d, options)| options[d]) + .collect(); + // Advance (mixed radix); `None` after the last assignment. + let mut carried = true; + for (digit, options) in current.iter_mut().zip(&options).rev() { + *digit += 1; + if *digit < options.len() { + carried = false; + break; + } + *digit = 0; + } + if carried { + digits = None; + } + let at_ingestion = |m: &Materialization| m.timing() == ExecutionTiming::IngestionTime; + let down_closed = assignment.iter().enumerate().all(|(u, m)| { + !at_ingestion(m) || below[u].iter().all(|&v| at_ingestion(&assignment[v])) + }); + if down_closed { + return Some(assignment); + } + digits.as_ref()?; }) } @@ -258,6 +646,13 @@ mod tests { use asap_types::post_asap::ExecutionTiming; use asap_types::types::AccuracyTarget; + /// The all-`NotMaterialized` candidate, with no workload declared. + fn first_candidate(roots: &[QueryRoot]) -> PhysicalCandidate { + optimize_physical_asap("L1", roots, &[], &DataWorkload::default()) + .unwrap() + .remove(0) + } + fn operator_root(candidate: &PhysicalCandidate, i: usize) -> Rc { match &candidate.roots[i] { QueryRoot::Operator(node) => node.clone(), @@ -299,7 +694,7 @@ mod tests { "topk by (job) (10, sum_over_time(m[1m]))", AccuracyTarget::exact(), ); - let candidate = optimize_physical_asap("L1", &[root.clone().into()]).unwrap(); + let candidate = first_candidate(&[root.clone().into()]); let physical = operator_root(&candidate, 0); assert_eq!(names(&physical), names(&root)); let limit = topk_limit(&physical); @@ -311,7 +706,7 @@ mod tests { #[test] fn promql_topk_over_grouped_aggregate_sorts_by_its_measure() { let root = lower_promql("topk(5, sum by (job) (m))", AccuracyTarget::exact()); - let candidate = optimize_physical_asap("L1", &[root.into()]).unwrap(); + let candidate = first_candidate(&[root.into()]); let physical = operator_root(&candidate, 0); assert_eq!(names(&physical), ["topk_5"]); let limit = topk_limit(&physical); @@ -328,7 +723,7 @@ mod tests { "sum by (job) (topk by (job) (10, sum_over_time(m[1m])))", AccuracyTarget::exact(), ); - let candidate = optimize_physical_asap("L1", &[root.clone().into()]).unwrap(); + let candidate = first_candidate(&[root.clone().into()]); let physical = operator_root(&candidate, 0); assert_eq!(names(&physical), names(&root)); let NonASAPOp::Aggregate { child: input, .. } = physical.expect_non_asap() else { @@ -394,7 +789,8 @@ mod tests { ), ]; for root in cases { - let error = optimize_physical_asap("L1", &[root.into()]).unwrap_err(); + let error = optimize_physical_asap("L1", &[root.into()], &[], &DataWorkload::default()) + .unwrap_err(); assert!( matches!(error, PhysicalASAPOptimizationError::ExactTopK(_)), "{error}" @@ -414,7 +810,7 @@ mod tests { panic!("topk aggregate") }; let sum = Rc::new(sum.with_new_children(|_| shared.clone()).unwrap()); - let candidate = optimize_physical_asap("L1", &[topk.into(), sum.into()]).unwrap(); + let candidate = first_candidate(&[topk.into(), sum.into()]); let root = |i: usize| match &candidate.roots[i] { QueryRoot::Operator(node) => node.clone(), QueryRoot::Scalar(_) => panic!("operator root"), @@ -497,7 +893,7 @@ mod tests { .into_iter() .map(|(_, root)| root) .collect(); - let candidate = optimize_physical_asap("L1", &roots).unwrap(); + let candidate = first_candidate(&roots); assert!(candidate .dag .nodes @@ -509,4 +905,380 @@ mod tests { .iter() .all(|n| n.output_state.timing == ExecutionTiming::QueryTime)); } + + // ── Materialization ────────────────────────────────────────────────── + + use asap_types::workload::{DataArrival, LatencyRequirement, RepetitionInterval, TimestampMs}; + + const MINUTE: u64 = 60_000; + + /// The composed logical candidate of `query` that builds its last + /// summary option (DDSketch for a quantile) for every target. + fn summary_root(query: &str) -> QueryRoot { + let root = lower_promql( + query, + AccuracyTarget::epsilon_delta(0.01, 0.001) + .with_metric(asap_types::types::ErrorMetric::Rank), + ); + let inventory = crate::per_computation_candidates::generate_per_computation_candidates( + vec![(0, QueryRoot::Operator(root))], + ) + .unwrap(); + let choice: Vec<_> = inventory + .targets + .iter() + .map(|t| t.choices.candidates.len() - 1) + .collect(); + crate::per_computation_candidates::compose_logical_candidate(&inventory, &choice) + .unwrap() + .remove(0) + .1 + } + + /// `root` with its summary build in 1-min tumbling panes. + fn in_panes(root: QueryRoot) -> QueryRoot { + let roots = [root]; + let sites = crate::asap_aware_cse::pane_sites(&roots, &[Some(MINUTE)]); + assert_eq!(sites.len(), 1, "{sites:?}"); + let mut variants = + crate::asap_aware_cse::window_composition_variants(&roots, &sites).unwrap(); + variants.pop().unwrap().roots.unwrap().remove(0) + } + + const AT_INGESTION: Materialization = Materialization::MatAtIngestion(Medium::Memory); + + /// The options `candidate` chose other than `NotMaterialized`, by node. + fn materialized(candidate: &PhysicalCandidate) -> Vec { + candidate + .materialization + .values() + .copied() + .filter(|m| *m != Materialization::NotMaterialized) + .collect() + } + + fn every_minute() -> QueryDemand { + QueryDemand { + recurrence: QueryRecurrence::Repeated(RepeatedDemand::FixedInterval( + RepetitionInterval(MINUTE as u32), + )), + predictability: Predictability::Predictable { known_at: None }, + response_latency: LatencyRequirement::Unspecified, + } + } + + fn arriving() -> DataWorkload { + DataWorkload { + arrival: DataArrival::ContinuouslyIngesting, + ..Default::default() + } + } + + /// The distinct nodes of `kind` the candidate's roots read. + fn node_of(candidate: &PhysicalCandidate, kind: &str) -> Vec> { + let mut nodes: Vec> = Vec::new(); + for root in candidate.roots.iter().flat_map(root_operators) { + for node in OperatorNode::reachable(root) { + if node.operator.kind_name() == kind && !nodes.iter().any(|n| Rc::ptr_eq(n, &node)) + { + nodes.push(node); + } + } + } + nodes + } + + /// #509 Example 4, B1 and B2: a tumbling-pane chain read by a repeating, + /// predictable query over arriving data is either rebuilt at query time + /// or maintained at ingestion time. Maintained, the chain and the scan + /// below it run at ingestion time, and the merge and estimate at query + /// time. + #[test] + fn a_pane_chain_over_arriving_data_may_be_maintained_at_ingestion_time() { + let root = in_panes(summary_root("quantile_over_time(0.99, m[5m])")); + let candidates = + optimize_physical_asap("L1", &[root], &[every_minute()], &arriving()).unwrap(); + assert_eq!(candidates.len(), 2); + let [b2, b1] = &candidates[..] else { + unreachable!() + }; + assert!(!b2.materializes_any()); + assert!(b2 + .dag + .nodes + .iter() + .all(|n| n.output_state.timing == ExecutionTiming::QueryTime)); + assert_eq!(materialized(b1), [AT_INGESTION]); + let [chain] = &node_of(b1, "PaneChain")[..] else { + panic!("one chain") + }; + assert_eq!( + chain.materialization, + Materialization::MatAtIngestion(Medium::Memory) + ); + for below in OperatorNode::reachable(chain) { + assert_eq!(below.timing, Some(ExecutionTiming::IngestionTime)); + } + for kind in ["SummaryMerge", "SummaryEstimate"] { + for node in node_of(b1, kind) { + assert_eq!(node.timing, Some(ExecutionTiming::QueryTime), "{kind}"); + } + } + } + + /// S4: maintaining state at ingestion time needs arriving data and + /// queries that repeat and are predictable; otherwise the chain only + /// runs at query time, and the unit says why. + #[test] + fn ingestion_time_needs_arriving_data_and_repeated_predictable_queries() { + use IngestionPruneReason as Why; + let root = in_panes(summary_root("quantile_over_time(0.99, m[5m])")); + let at_rest = DataWorkload { + arrival: DataArrival::AtRest, + ..Default::default() + }; + let unknown = QueryDemand { + predictability: Predictability::Unknown, + ..every_minute() + }; + let once = QueryDemand { + recurrence: QueryRecurrence::OneTime { + invocations: 1, + execute_at: None, + }, + ..every_minute() + }; + for (demand, data, why) in [ + (every_minute(), at_rest, Why::NotIngesting), + (every_minute(), DataWorkload::default(), Why::NotIngesting), + (unknown, arriving(), Why::NotPredictable), + (once, arriving(), Why::NotRepeated), + ] { + let roots = [root.clone()]; + let candidates = + optimize_physical_asap("L1", &roots, std::slice::from_ref(&demand), &data).unwrap(); + assert_eq!(candidates.len(), 1, "{why:?}"); + let mut memo = HashMap::new(); + let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); + let units = materialization_units(&implemented, &[demand], &data); + assert_eq!(units.len(), 1); + assert_eq!(units[0].at_ingestion, Err(why)); + } + } + + /// A counter state (`rate`, `increase`) needs each series' samples in + /// time order. Continuously ingesting time-series (PromQL) data is taken + /// to arrive in that order, as Prometheus assumes, so its counter panes + /// may be maintained at ingestion time. + #[test] + fn counter_panes_over_ingesting_promql_data_run_at_ingestion_time() { + for query in ["rate(m[5m])", "increase(m[5m])"] { + let roots = [in_panes(summary_root(query))]; + let mut memo = HashMap::new(); + let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); + let units = materialization_units(&implemented, &[every_minute()], &arriving()); + assert_eq!(units[0].at_ingestion, Ok(()), "{query}"); + let candidates = + optimize_physical_asap("L1", &roots, &[every_minute()], &arriving()).unwrap(); + assert_eq!(candidates.len(), 2, "{query}"); + } + } + + /// Only continuously ingesting time-series data is taken to arrive in + /// time order: a counter over a table source, or over mixed data (whose + /// at-rest part may be loaded in any order), stays at query time. + #[test] + fn counter_panes_over_other_sources_stay_at_query_time() { + use IngestionPruneReason as Why; + let root = in_panes(summary_root("rate(m[5m])")); + let QueryRoot::Operator(node) = &root else { + panic!("{root:?}") + }; + let table = QueryRoot::Operator(to_table(node)); + let mixed = DataWorkload { + arrival: DataArrival::Mixed, + ..Default::default() + }; + for (root, data) in [(table, arriving()), (root.clone(), mixed)] { + let roots = [root]; + let mut memo = HashMap::new(); + let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); + let units = materialization_units(&implemented, &[every_minute()], &data); + assert_eq!(units[0].at_ingestion, Err(Why::CounterNeedsTimeOrder)); + } + } + + /// `node` with every time-series scan turned into a table scan of the + /// same name and schema. + fn to_table(node: &Rc) -> Rc { + let mut out = (**node).clone(); + out.operator = node.operator.map_children(to_table); + if let Operator::NonASAP(NonASAPOp::Scan { source, .. }) = &mut out.operator { + if let Source::TimeSeries { metric } = source { + *source = Source::Table { + table_ref: metric.clone(), + }; + } + } + Rc::new(out) + } + + /// A whole-window build is maintained only for one window per + /// evaluation at a known phase: a fixed interval with a phase, a window + /// no longer than it, and no filter. + #[test] + fn a_whole_window_build_needs_a_known_phase_and_a_window_within_the_interval() { + use IngestionPruneReason as Why; + let root = summary_root("quantile_over_time(0.99, m[1m])"); + let at = |interval_ms: u32| QueryDemand { + recurrence: QueryRecurrence::Repeated(RepeatedDemand::FixedIntervalAt { + interval: RepetitionInterval(interval_ms), + evaluation_phase: TimestampMs(0), + }), + ..every_minute() + }; + let units = |root: &QueryRoot, demand: QueryDemand| { + let mut memo = HashMap::new(); + let implemented = + map_roots(std::slice::from_ref(root), &mut |n| implement(n, &mut memo)).unwrap(); + materialization_units(&implemented, &[demand], &arriving()) + .remove(0) + .at_ingestion + }; + assert_eq!(units(&root, at(MINUTE as u32)), Ok(())); + assert_eq!(units(&root, every_minute()), Err(Why::WindowNotFixed)); + assert_eq!(units(&root, at(30_000)), Err(Why::WindowNotFixed)); + let candidates = optimize_physical_asap( + "L1", + std::slice::from_ref(&root), + &[at(MINUTE as u32)], + &arriving(), + ) + .unwrap(); + assert_eq!(materialized(&candidates[1]), [AT_INGESTION]); + + // The same build with a filter. + let QueryRoot::Operator(node) = &root else { + unreachable!() + }; + let build = OperatorNode::reachable(node) + .into_iter() + .find(|n| matches!(n.asap(), Some(ASAPOp::SummaryAgg { .. }))) + .unwrap(); + let Operator::ASAP(ASAPOp::SummaryAgg { + child, + family, + input, + reduction, + grouping, + .. + }) = build.operator.clone() + else { + unreachable!() + }; + let filtered = Rc::new( + OperatorNode::with_schema( + Operator::ASAP(ASAPOp::SummaryAgg { + child, + family, + input, + reduction, + grouping, + filter: Some(asap_types::ir::Predicate(ScalarExpr::Literal( + asap_types::pre_asap::expr_ir::ScalarValue::Boolean(true), + ))), + }), + build.schema.clone(), + ) + .with_guarantee(build.guarantee.clone()), + ); + assert_eq!( + units(&QueryRoot::Operator(filtered), at(MINUTE as u32)), + Err(Why::Filtered) + ); + } + + /// A build two queries read is also offered built once per evaluation + /// for both (`MatAtQuery`); a build one query reads is not. + #[test] + fn a_build_two_queries_read_may_be_built_once_per_evaluation() { + let QueryRoot::Operator(p99) = summary_root("quantile_over_time(0.99, m[1m])") else { + unreachable!() + }; + let build = OperatorNode::reachable(&p99) + .into_iter() + .find(|n| matches!(n.asap(), Some(ASAPOp::SummaryAgg { .. }))) + .unwrap(); + let p50 = Rc::new( + OperatorNode::new(Operator::ASAP(ASAPOp::SummaryEstimate { + summary_input: Rc::clone(&build), + query: asap_types::post_asap::SketchStatistic::Quantile { q: 0.5 }, + })) + .unwrap(), + ); + let roots = [QueryRoot::Operator(p99), QueryRoot::Operator(p50)]; + let candidates = + optimize_physical_asap("L1", &roots, &[], &DataWorkload::default()).unwrap(); + assert_eq!(candidates.len(), 2); + assert_eq!( + materialized(&candidates[1]), + [Materialization::MatAtQuery(Medium::Memory)] + ); + let [build] = &node_of(&candidates[1], "SummaryAgg")[..] else { + panic!("one shared build") + }; + assert_eq!( + build.materialization, + Materialization::MatAtQuery(Medium::Memory) + ); + } + + /// Two queries share one scan: one reads it through panes maintained at + /// ingestion time, the other at query time. The scan is split, one copy + /// per phase; with nothing materialized it stays one node. + #[test] + fn a_scan_two_queries_read_at_two_phases_is_split() { + let QueryRoot::Operator(panes) = in_panes(summary_root("quantile_over_time(0.99, m[5m])")) + else { + unreachable!() + }; + let scan = OperatorNode::reachable(&panes) + .into_iter() + .find(|n| matches!(n.non_asap(), Some(NonASAPOp::Scan { .. }))) + .unwrap(); + let ranged = OperatorNode::new_shared(Operator::NonASAP(NonASAPOp::TimeRange { + range: std::time::Duration::from_millis(5 * MINUTE), + kind: asap_types::ir::TimeRangeKind::Range, + child: Rc::clone(&scan), + })) + .unwrap(); + let exact = crate::test_support::aggregate( + Reduction::by(vec![]), + vec![AggIntent::Max { col: None }], + vec![], + None, + ranged, + ); + let roots = [QueryRoot::Operator(panes), QueryRoot::Operator(exact)]; + let candidates = + optimize_physical_asap("L1", &roots, &[every_minute(), every_minute()], &arriving()) + .unwrap(); + assert_eq!(candidates.len(), 2); + let scans = |c: &PhysicalCandidate| { + let mut timings: Vec<_> = c + .dag + .nodes + .iter() + .filter(|n| matches!(n.payload, Payload::NonASAP(NonASAPOp::Scan { .. }))) + .map(|n| n.output_state.timing) + .collect(); + timings.sort_by_key(|t| *t == ExecutionTiming::QueryTime); + timings + }; + assert_eq!(scans(&candidates[0]), [ExecutionTiming::QueryTime]); + assert_eq!( + scans(&candidates[1]), + [ExecutionTiming::IngestionTime, ExecutionTiming::QueryTime] + ); + } } diff --git a/crates/asap-aware-mapping/src/stage3_plan_selection.rs b/crates/asap-aware-mapping/src/stage3_plan_selection.rs index 40d4393cd..45c6a0ee7 100644 --- a/crates/asap-aware-mapping/src/stage3_plan_selection.rs +++ b/crates/asap-aware-mapping/src/stage3_plan_selection.rs @@ -11,6 +11,8 @@ //! over weights proven non-negative; a query without one constrains nothing. //! A miss rejects the candidate as invalid, with a reason; only this stage //! discards valid candidates. +//! A candidate whose evaluation of some query takes longer than that +//! query's latency bound is rejected as invalid too ("Latency" below). //! Every valid candidate is priced node by node over its physical DAG, and //! the cheapest is selected. The rest are reported valid but costlier. //! Selection prices every candidate it is given; a search that avoids @@ -31,21 +33,30 @@ //! it, counted without looking through a materialized node: a node below //! one is computed when that node is. Stage 2 does not duplicate a shared //! node, so a shared `NotMaterialized` input costs what reading it -//! separately does (#509 Example 4). +//! separately does (#509 Example 4); it offers the node built once per +//! evaluation (`MatAtQuery`) as another candidate. //! * A `MatAtQuery` node is computed once for all the queries that reach //! it, at their combined rate: queries repeating at the same interval are //! evaluated together, so each distinct interval counts once. //! * A `MatAtIngestion` node runs as data arrives: it is priced over one //! second of arriving rows, once per second, whatever its readers' rates. +//! A tumbling-pane chain maintained this way updates only its newest +//! pane: each arriving row is placed in it and updates it. //! * A query repeating every `I` ms runs `1000 / I` times per second, and an //! estimated rate runs at that rate. One-off, scheduled and unknown //! queries are spread over the calibration's `horizon_s` (default //! 3600 s): `invocations / horizon_s` per second. //! -//! Memory is charged only as state kept between computations: a -//! materialized node's state, `cost_per_retained_byte_second` per byte per -//! second, once for `MatAtQuery` and twice for `MatAtIngestion` (the window -//! being built and the completed one queries read). Memory a computation +//! Memory is charged only as state kept between computations, at +//! `cost_per_retained_byte_second` per byte per second. A `MatAtIngestion` +//! node keeps its state every second: twice for a whole window (the window +//! being built and the completed one queries read) and `N + 1` panes for a +//! chain of `N` (the `N` the query merges and the one being built). A +//! `MatAtQuery` node's state is reused only within one evaluation, so it is +//! held only while that evaluation runs: its bytes times the latency of the +//! longest query reading it, once per evaluation, which is close to nothing. +//! Keeping it across evaluations comes later, charged by its retention. +//! Memory a computation //! holds only while it runs is not charged, and `cost_per_retained_byte` is //! ignored: peak capacity belongs to cost model 2 (#683). A computation is //! charged for its CPU operations and scanned bytes only. @@ -67,8 +78,24 @@ //! illustrative, not calibrated: a binary, join or concat node is priced from //! its first input only (MVP; follow-up). //! A cost error on any candidate aborts selection; it is reachable only from -//! bad declared rates. Latency bounds and deployment capabilities are not -//! checked yet. +//! bad declared rates. Deployment capabilities are not checked yet. +//! +//! ## Latency +//! +//! Following the sketch-bench RQE cost model (§5, batch latency), a query's +//! latency per evaluation is its longest chain of work, each step on a +//! full core of elastic CPU (no queueing): the compaction of the newest +//! window of an ingestion-time state it reads, then its own query-time +//! work. Its own work is the sum, over every query-time node it reaches +//! (shared ones included, each once), of one computation's CPU operations +//! and scanned bytes timed by the calibration's `ms_per_cpu_op` and +//! `ms_per_scan_byte`. A state whose ingestion work needs `k` cores keeps +//! `k` partial copies of its newest window, and compacting them takes +//! `(k − 1)` one-operation merges for each of its states per window; with +//! one core there is nothing to compact. A query with +//! `LatencyRequirement::ExplicitMaxMs(bound)` whose latency is above the +//! bound makes the candidate invalid, with the latency as the reason. +//! [`CandidateCost::latency`] reports every query's latency. use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::rc::Rc; @@ -89,7 +116,9 @@ use asap_types::post_asap::{ }; use asap_types::pre_asap::{AggIntent, DataType, Reduction, ScalarValue, Schema}; use asap_types::types::{AccuracyScope, AccuracyTarget}; -use asap_types::workload::{DataWorkload, MetricType, QueryRecurrence, RepeatedDemand}; +use asap_types::workload::{ + DataWorkload, LatencyRequirement, MetricType, QueryDemand, QueryRecurrence, RepeatedDemand, +}; use thiserror::Error; use crate::accuracy::composition::{ @@ -120,7 +149,8 @@ pub const COST_SOURCE: &str = "analytical-cost-v2 (illustrative statistics)"; /// The coefficients plan selection prices with until a deployment is /// calibrated: 1 ns of CPU per operation, 0.1 ns per scanned byte, /// 1 GB kept for a second costs 1/8 vCPU (125 CPU-ms), and one-off work is -/// spread over one hour. +/// spread over one hour. The latency check takes the same times: one cost +/// unit is one millisecond of one core. pub fn illustrative_calibration() -> ResourceCalibration { ResourceCalibration { cost_per_cpu_op: 1e-6, @@ -129,6 +159,8 @@ pub fn illustrative_calibration() -> ResourceCalibration { cost_per_retained_byte: 0.0, cost_per_retained_byte_second: 1.25e-7, horizon_s: crate::analytical_cost::DEFAULT_HORIZON_S, + ms_per_cpu_op: 1e-6, + ms_per_scan_byte: 1e-7, version: "illustrative-v2".into(), } } @@ -153,13 +185,50 @@ pub struct NodeCost { } /// Whole-workload cost of one candidate: one entry per DAG node, `total` is -/// their sum. +/// their sum. `latency[i]` is query `i`'s latency per evaluation. #[derive(Debug, Clone, PartialEq)] pub struct CandidateCost { pub total: f64, pub unit: &'static str, pub source: &'static str, pub per_node: BTreeMap, + pub latency: Vec, +} + +/// One query's latency per evaluation, its longest chain of work (module +/// doc, "Latency"): the compaction of the newest window of a state it reads +/// from ingestion time, then the query's own work, each on a full core. +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct QueryLatency { + pub compaction_ms: f64, + pub query_ms: f64, +} + +impl QueryLatency { + pub fn total_ms(&self) -> f64 { + self.compaction_ms + self.query_ms + } +} + +/// The first query whose latency is over its bound, as a rejection reason. +fn latency_violation(cost: &CandidateCost, demand: &[QueryDemand]) -> Option { + cost.latency + .iter() + .zip(demand) + .enumerate() + .find_map(|(query, (latency, demand))| match demand.response_latency { + LatencyRequirement::ExplicitMaxMs(bound) if latency.total_ms() > bound => { + Some(format!( + "q{}: latency {:.1} ms per evaluation (compaction {:.1} ms + query {:.1} ms) \ + is over its {bound} ms bound", + query + 1, + latency.total_ms(), + latency.compaction_ms, + latency.query_ms + )) + } + _ => None, + }) } /// A candidate that was not selected. `valid == false`: it failed a check; @@ -259,13 +328,14 @@ pub enum SelectionError { } /// Stage 3 (plan selection): reject candidates that miss a query's accuracy -/// target, price the rest per second and select the cheapest (the first on -/// ties). `targets[i]` is the requirement of `candidate.roots[i]` (`None` -/// imposes none) and `recurrence[i]` how often it is evaluated. +/// target or latency bound, price the rest per second and select the +/// cheapest (the first on ties). `targets[i]` is the requirement of +/// `candidate.roots[i]` (`None` imposes none) and `demand[i]` how it is +/// demanded: how often it is evaluated and its latency bound. pub fn select_plan( cands: &[PhysicalCandidate], targets: &[Option], - recurrence: &[QueryRecurrence], + demand: &[QueryDemand], data: &DataWorkload, models: PlanningModels<'_>, ) -> Result { @@ -273,6 +343,7 @@ pub fn select_plan( let mut accepted = BTreeMap::new(); let mut rejected = Vec::new(); let mut best: Option<(String, f64, Vec)> = None; + let recurrence: Vec = demand.iter().map(|d| d.recurrence.clone()).collect(); for candidate in cands { if candidate.roots.len() != targets.len() || candidate.roots.len() != recurrence.len() { return Err(SelectionError::TargetCount { @@ -302,13 +373,21 @@ pub fn select_plan( }; let calibration = illustrative_calibration(); let cost = - price(&candidate.dag, recurrence, data, &calibration).map_err(|(node, error)| { + price(&candidate.dag, &recurrence, data, &calibration).map_err(|(node, error)| { SelectionError::Cost { candidate: candidate.id.clone(), node, error, } })?; + if let Some(reason) = latency_violation(&cost, demand) { + rejected.push(Rejection { + id: candidate.id.clone(), + valid: false, + reason, + }); + continue; + } if best .as_ref() .is_none_or(|(_, total, _)| cheaper(cost.total, *total)) @@ -1229,6 +1308,12 @@ fn price( computations(dag, recurrence, calibration.horizon_s).map_err(|error| (first, error))?; let mut output: HashMap = HashMap::new(); let mut per_node = BTreeMap::new(); + // Each node's work in ms on one core: one computation at query time, + // one second of arriving rows at ingestion time. + let mut work_ms: HashMap = HashMap::new(); + // MatAtQuery state, held only while one evaluation runs: (bytes, per + // second), charged once the evaluations' latencies are known. + let mut held: HashMap = HashMap::new(); for node in &dag.nodes { let ingestion = node.output_state.timing == ExecutionTiming::IngestionTime; let inputs: Vec<_> = dag @@ -1520,6 +1605,11 @@ fn price( ), }; let estimate = estimate.map_err(|error| (node.id, error))?; + work_ms.insert( + node.id, + estimate.cpu_ops() * calibration.ms_per_cpu_op + + estimate.scan_bytes() as f64 * calibration.ms_per_scan_byte, + ); // A computation is charged for its CPU work and scanned bytes; memory // only as kept state, below. let cost = estimate @@ -1528,15 +1618,28 @@ fn price( let (multiplier, per_second) = multipliers[&node.id]; let mut cost = cost * per_second; let mut detail = format!("{detail}; x {per_second:.4}/s"); - // State kept between computations: the window being built and the - // completed one at ingestion time, the kept output at query time. - // The state is what the node holds: its output, or the values an - // exact aggregate keeps per group when that is more. + // State kept between computations: at ingestion time, the window + // being built and the completed ones queries read (a chain of N + // panes keeps N + 1), every second. At query time the output is + // reused only within one evaluation, so it is held only while that + // evaluation runs (charged below, once latencies are known). The + // state is what the node holds: its output, or the values an exact + // aggregate keeps per group when that is more. let state = out.bytes.max(estimate.peak_memory_bytes()); - let kept = match node.materialization { - Materialization::NotMaterialized => 0, - Materialization::MatAtIngestion(_) => 2 * state, - _ => state, + let kept = match (node.materialization, &node.payload) { + (Materialization::NotMaterialized, _) => 0, + (Materialization::MatAtQuery(_), _) => { + held.insert(node.id, (state, per_second)); + 0 + } + ( + Materialization::MatAtIngestion(_), + Payload::ASAP(ASAPOp::PaneChain { pane_count, .. }), + ) => { + let panes = u64::from(*pane_count).max(1); + state / panes * (panes + 1) + } + (Materialization::MatAtIngestion(_), _) => 2 * state, }; if kept > 0 { cost += calibration.cost_per_retained_byte_second * kept as f64; @@ -1556,14 +1659,125 @@ fn price( }, ); } + let latency = query_latencies(dag, &nodes, &output, &work_ms, calibration); + // A MatAtQuery state is held for one evaluation: from its build until + // the longest query reading it finishes, about that query's latency. + for (id, (state, per_second)) in held { + let evaluation_ms = query_reach(dag, &nodes) + .iter() + .zip(&latency) + .filter(|(reached, _)| reached.contains(&id)) + .map(|(_, l)| l.total_ms()) + .fold(0.0, f64::max); + let byte_seconds = state as f64 * evaluation_ms / 1_000.0 * per_second; + let node = per_node.get_mut(&id).expect("every node is priced"); + node.cost += calibration.cost_per_retained_byte_second * byte_seconds; + node.detail += &format!("; holds {state} bytes for {evaluation_ms:.1} ms"); + if !node.cost.is_finite() { + return Err((id, AnalyticalCostError::Overflow)); + } + } Ok(CandidateCost { total: per_node.values().map(|n| n.cost).sum(), unit: COST_UNIT, source: COST_SOURCE, per_node, + latency, }) } +/// Each query's latency per evaluation (module doc, "Latency"): the sum of +/// the query-time work it reaches, each node once, plus the longest +/// compaction among the ingestion-time states it reads. Compacting a +/// state's newest window merges, for each of its `I` states per window, +/// the `k` ingest workers' partial copies, `(k − 1)·I` merges of one +/// operation each, where `k` is the cores its ingestion work takes, at +/// least one. +fn query_latencies( + dag: &PhysicalASAPDAG, + nodes: &HashMap, + output: &HashMap, + work_ms: &HashMap, + calibration: &ResourceCalibration, +) -> Vec { + let inputs = |id: PhysicalASAPNodeId| { + dag.edges + .iter() + .filter(move |e| e.consumer == id) + .map(|e| e.producer) + }; + let at_ingestion = + |id: PhysicalASAPNodeId| nodes[&id].output_state.timing == ExecutionTiming::IngestionTime; + let compaction_ms = |state: PhysicalASAPNodeId| { + let mut ingest_ms_per_s = 0.0; + let mut seen = HashSet::new(); + let mut stack = vec![state]; + while let Some(id) = stack.pop() { + if seen.insert(id) { + ingest_ms_per_s += work_ms[&id]; + stack.extend(inputs(id)); + } + } + let workers = (ingest_ms_per_s / 1_000.0).ceil().max(1.0); + let panes = match &nodes[&state].payload { + Payload::ASAP(ASAPOp::PaneChain { pane_count, .. }) => u64::from(*pane_count).max(1), + _ => 1, + }; + let states = (output[&state].rows / panes) as f64; + (workers - 1.0) * states * calibration.ms_per_cpu_op + }; + query_starts(dag) + .into_iter() + .map(|start| { + let mut latency = QueryLatency { + compaction_ms: 0.0, + query_ms: 0.0, + }; + let mut seen = HashSet::new(); + let mut stack = start; + while let Some(id) = stack.pop() { + if !seen.insert(id) { + continue; + } + if at_ingestion(id) { + latency.compaction_ms = latency.compaction_ms.max(compaction_ms(id)); + continue; + } + latency.query_ms += work_ms[&id]; + stack.extend(inputs(id)); + } + latency + }) + .collect() +} + +/// The nodes each query reaches at query time, in workload order: its walk +/// from its roots, stopping at (and including) ingestion-time nodes. +fn query_reach( + dag: &PhysicalASAPDAG, + nodes: &HashMap, +) -> Vec> { + query_starts(dag) + .into_iter() + .map(|mut stack| { + let mut seen = HashSet::new(); + while let Some(id) = stack.pop() { + if seen.insert(id) + && nodes[&id].output_state.timing != ExecutionTiming::IngestionTime + { + stack.extend( + dag.edges + .iter() + .filter(|e| e.consumer == id) + .map(|e| e.producer), + ); + } + } + seen + }) + .collect() +} + /// The windows, in milliseconds, read above the scan `scan` at query time: /// each range `TimeRange` and `PaneChain` (its whole window) reached /// through time shifts, which move a window without widening it. @@ -1757,10 +1971,14 @@ mod tests { use asap_types::workload::{Evidence, Rate}; /// `n` queries repeating every 10 s, as Example 1's panels do. - fn every_10s(n: usize) -> Vec { + fn recurrences(n: usize) -> Vec { vec![repeating(10_000); n] } + fn every_10s(n: usize) -> Vec { + vec![repeating(10_000).into(); n] + } + /// A query repeating every `interval_ms`. fn repeating(interval_ms: u32) -> QueryRecurrence { QueryRecurrence::Repeated(RepeatedDemand::FixedInterval( @@ -1831,7 +2049,9 @@ mod tests { .into_iter() .map(|(_, root)| root) .collect(); - let mut candidate = optimize_physical_asap("L", &roots).unwrap(); + let mut candidate = optimize_physical_asap("L", &roots, &[], &data()) + .unwrap() + .remove(0); candidate.id = format!("P{}", index + 1); candidate }) @@ -2200,8 +2420,11 @@ mod tests { let mut candidate = optimize_physical_asap( "L", &[QueryRoot::Operator(outer), QueryRoot::Operator(inner)], + &[], + &data(), ) - .unwrap(); + .unwrap() + .remove(0); let [outer, inner] = candidate.dag.roots[..] else { panic!("two roots") }; @@ -2210,7 +2433,7 @@ mod tests { cost_per_retained_byte_second: 0.0, ..illustrative_calibration() }; - let cost = price(&candidate.dag, &every_10s(2), &data(), &calibration).unwrap(); + let cost = price(&candidate.dag, &recurrences(2), &data(), &calibration).unwrap(); let multipliers: BTreeMap<_, _> = cost .per_node .iter() @@ -2232,7 +2455,7 @@ mod tests { .find(|n| n.id == inner) .unwrap(); node.materialization = Materialization::MatAtQuery(asap_types::ir::Medium::Memory); - let stored = price(&candidate.dag, &every_10s(2), &data(), &calibration).unwrap(); + let stored = price(&candidate.dag, &recurrences(2), &data(), &calibration).unwrap(); for (id, c) in &stored.per_node { assert_eq!(c.multiplier, 1, "node {id} is computed once"); let once = cost.per_node[id].cost / multipliers[id] as f64; @@ -2273,7 +2496,9 @@ mod tests { .into_iter() .map(|(_, root)| root) .collect(); - let mut candidate = optimize_physical_asap("L", &roots).unwrap(); + let mut candidate = optimize_physical_asap("L", &roots, &[], &data()) + .unwrap() + .remove(0); candidate.id = format!("P{}", index + 1); candidate }) @@ -2565,7 +2790,9 @@ mod tests { } /// `candidates` with every state node (a summary build or an exact - /// aggregate) kept at query time, so selection charges its kept bytes. + /// aggregate) kept at ingestion time, so selection charges its kept + /// bytes every second (a `MatAtQuery` state is held only for one + /// evaluation). fn keeping_state(mut candidates: Vec) -> Vec { for candidate in &mut candidates { for node in &mut candidate.dag.nodes { @@ -2575,7 +2802,7 @@ mod tests { | Payload::NonASAP(NonASAPOp::Aggregate { .. }) ) { node.materialization = - Materialization::MatAtQuery(asap_types::ir::Medium::Memory); + Materialization::MatAtIngestion(asap_types::ir::Medium::Memory); } } } @@ -2939,7 +3166,7 @@ mod tests { let run = crate::pass::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], &[Some(selected.clone())], - &[QueryRecurrence::Unknown], + &[QueryRecurrence::Unknown.into()], data, models, ) @@ -3503,7 +3730,10 @@ mod tests { .into_iter() .map(|(_, root)| root) .collect(); - optimize_physical_asap("L1", &roots).unwrap().dag + optimize_physical_asap("L1", &roots, &[], &data()) + .unwrap() + .remove(0) + .dag } /// A time shift is free and does not change what the scan below it @@ -3578,9 +3808,12 @@ mod tests { )); } - /// Kept state is charged per byte per second: twice the state's bytes at - /// ingestion time (the window being built and the completed one), once - /// at query time; state computed and dropped within a query has none. + /// Kept state is charged per byte per second: at ingestion time, twice + /// the state's bytes (the window being built and the completed one) for + /// every second. At query time the state is reused only within one + /// evaluation, so it is held only while that evaluation runs: its bytes + /// times the evaluation's latency, once per evaluation. State computed + /// and dropped within a query has none. #[test] fn kept_state_is_charged_per_byte_per_second() { let cost = |dag: &PhysicalASAPDAG, w| { @@ -3588,9 +3821,9 @@ mod tests { cost_per_retained_byte_second: w, ..illustrative_calibration() }; - price(dag, &every_10s(1), &data(), &calibration).unwrap() + price(dag, &recurrences(1), &data(), &calibration).unwrap() }; - for (materialization, windows) in [(AT_INGESTION, 2.0), (AT_QUERY, 1.0)] { + for materialization in [AT_INGESTION, AT_QUERY] { let dag = kll_dag(materialization); let build = node_of(&dag, is_build); let (with, without) = (cost(&dag, 1.25e-7), cost(&dag, 0.0)); @@ -3600,9 +3833,20 @@ mod tests { unreachable!() }; // One state per series: data() declares 10 000. - let kept = windows * 10_000.0 * summary_shape(family).1 as f64; + let state = 10_000.0 * summary_shape(family).1 as f64; + let byte_seconds = if materialization == AT_INGESTION { + 2.0 * state + } else { + let evaluation_s = with.latency[0].total_ms() / 1_000.0; + assert!(evaluation_s > 0.0 && evaluation_s < 1.0, "{evaluation_s}"); + state * evaluation_s * with.per_node[&build].per_second + }; let term = with.per_node[&build].cost - without.per_node[&build].cost; - assert!(close(term, 1.25e-7 * kept), "{materialization:?}: {term}"); + assert!( + close(term, 1.25e-7 * byte_seconds), + "{materialization:?}: {term} vs {}", + 1.25e-7 * byte_seconds + ); assert!(close(with.total - without.total, term)); } let transient = kll_dag(Materialization::NotMaterialized); @@ -3621,15 +3865,16 @@ mod tests { ] { let target = AccuracyTarget::exact(); let root = lower_promql(query, target); - let dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)]) + let dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)], &[], &data()) .unwrap() + .remove(0) .dag; let total = |per_computation_memory| { let calibration = ResourceCalibration { cost_per_retained_byte: per_computation_memory, ..illustrative_calibration() }; - price(&dag, &every_10s(1), &data(), &calibration) + price(&dag, &recurrences(1), &data(), &calibration) .unwrap() .total }; @@ -3642,7 +3887,7 @@ mod tests { cost_per_retained_byte: per_computation_memory, ..illustrative_calibration() }; - price(&dag, &every_10s(1), &data(), &calibration) + price(&dag, &recurrences(1), &data(), &calibration) .unwrap() .total }; @@ -3657,8 +3902,9 @@ mod tests { fn kept_exact_state_is_charged_by_the_values_it_keeps() { let kept = |query: &str| { let root = lower_promql(query, AccuracyTarget::exact()); - let mut dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)]) + let mut dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)], &[], &data()) .unwrap() + .remove(0) .dag; let aggregate = dag .nodes @@ -3672,7 +3918,7 @@ mod tests { cost_per_retained_byte_second: w, ..illustrative_calibration() }; - price(&dag, &every_10s(1), &data(), &calibration) + price(&dag, &recurrences(1), &data(), &calibration) .unwrap() .per_node[&id] .cost @@ -3692,14 +3938,18 @@ mod tests { #[test] fn rates_follow_per_consumer_charging() { let root = lower_promql("sum by (job) (rate(m[1m]))", AccuracyTarget::exact()); - let one = optimize_physical_asap("L", &[QueryRoot::Operator(root.clone())]) + let one = optimize_physical_asap("L", &[QueryRoot::Operator(root.clone())], &[], &data()) .unwrap() + .remove(0) .dag; let mut two = optimize_physical_asap( "L", &[QueryRoot::Operator(root.clone()), QueryRoot::Operator(root)], + &[], + &data(), ) .unwrap() + .remove(0) .dag; let without_memory = ResourceCalibration { cost_per_retained_byte_second: 0.0, @@ -3710,15 +3960,15 @@ mod tests { .unwrap() .total }; - let single = total(&one, &every_10s(1)); + let single = total(&one, &recurrences(1)); let mixed = [repeating(10_000), repeating(20_000)]; - assert!(close(total(&two, &every_10s(2)), 2.0 * single)); + assert!(close(total(&two, &recurrences(2)), 2.0 * single)); assert!(close(total(&two, &mixed), 1.5 * single)); assert_eq!(two.roots[0], two.roots[1], "one root node for both queries"); for node in &mut two.nodes { node.materialization = AT_QUERY; } - assert!(close(total(&two, &every_10s(2)), single)); + assert!(close(total(&two, &recurrences(2)), single)); assert!(close(total(&two, &mixed), 1.5 * single)); } @@ -3727,8 +3977,9 @@ mod tests { #[test] fn one_off_recurrence_is_spread_over_the_horizon() { let root = lower_promql("sum by (job) (rate(m[1m]))", AccuracyTarget::exact()); - let dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)]) + let dag = optimize_physical_asap("L", &[QueryRoot::Operator(root)], &[], &data()) .unwrap() + .remove(0) .dag; let horizon = illustrative_calibration().horizon_s; assert_eq!(horizon, 3_600.0); @@ -3762,7 +4013,207 @@ mod tests { ..illustrative_calibration() }, ] { - assert!(price(&dag, &every_10s(1), &data(), &calibration).is_err()); + assert!(price(&dag, &recurrences(1), &data(), &calibration).is_err()); } } + + // ── Stage 2 materialization and the latency check ──────────────────── + + const MINUTE: u32 = 60_000; + + fn every_minute() -> QueryDemand { + QueryDemand { + recurrence: repeating(MINUTE), + predictability: asap_types::workload::Predictability::Predictable { known_at: None }, + response_latency: LatencyRequirement::Unspecified, + } + } + + /// [`data`] arriving at `rows_per_s`. + fn arriving(rows_per_s: f64) -> DataWorkload { + DataWorkload { + arrival: asap_types::workload::DataArrival::ContinuouslyIngesting, + ingestion_rate: Evidence { + value: Some(Rate(rows_per_s)), + ..Default::default() + }, + ..data() + } + } + + /// The physical candidates of a per-series p99 over 5 min with its KLL + /// in five 1-min tumbling panes, every minute over data arriving at + /// `rows_per_s`: rebuilt at query time (B2), then maintained at + /// ingestion time (B1). + fn pane_candidates(rows_per_s: f64) -> Vec { + let root = lower_promql( + "quantile_over_time(0.99, m[5m])", + AccuracyTarget::epsilon_delta(0.01, 0.001).with_metric(ErrorMetric::Rank), + ); + let inventory = crate::per_computation_candidates::generate_per_computation_candidates( + vec![(0, QueryRoot::Operator(root))], + ) + .unwrap(); + let kll = inventory.targets[0] + .choices + .candidates + .iter() + .position(|c| { + matches!( + c, + crate::per_computation_candidates::ComputationCandidate::Summary( + SketchAlgorithm::Kll + ) + ) + }) + .unwrap(); + let roots: Vec<_> = + crate::per_computation_candidates::compose_logical_candidate(&inventory, &[kll]) + .unwrap() + .into_iter() + .map(|(_, root)| root) + .collect(); + let sites = crate::asap_aware_cse::pane_sites(&roots, &[Some(u64::from(MINUTE))]); + let roots = crate::asap_aware_cse::window_composition_variants(&roots, &sites) + .unwrap() + .pop() + .unwrap() + .roots + .unwrap(); + let mut candidates = + optimize_physical_asap("L1", &roots, &[every_minute()], &arriving(rows_per_s)).unwrap(); + for (k, c) in candidates.iter_mut().enumerate() { + c.id = format!("P1-m{k}"); + } + assert_eq!(candidates.len(), 2); + candidates + } + + fn is_chain(payload: &Payload) -> bool { + matches!(payload, Payload::ASAP(ASAPOp::PaneChain { .. })) + } + + /// #509 Example 4, B1: maintained at ingestion time, a chain of N panes + /// pays the update of the newest pane only, one second of arriving rows + /// once per second, and keeps N + 1 panes (the N the query merges and + /// the one being built) per series. + #[test] + fn a_chain_at_ingestion_pays_the_newest_pane_and_keeps_n_plus_one_panes() { + let candidates = pane_candidates(10_000.0); + let dag = &candidates[1].dag; + let chain = node_of(dag, is_chain); + let Payload::ASAP(ASAPOp::PaneChain { + family, pane_count, .. + }) = &dag.nodes.iter().find(|n| n.id == chain).unwrap().payload + else { + unreachable!() + }; + assert_eq!(*pane_count, 5); + let (depth, state_bytes) = summary_shape(family); + let recurrence = [repeating(MINUTE)]; + let without_memory = ResourceCalibration { + cost_per_retained_byte_second: 0.0, + ..illustrative_calibration() + }; + let work = &price(dag, &recurrence, &arriving(10_000.0), &without_memory) + .unwrap() + .per_node[&chain]; + assert_eq!(work.per_second, 1.0); + assert!( + close(work.cost, 10_000.0 * (depth + 1.0) * 1e-6), + "{work:?}" + ); + let with_memory = &price( + dag, + &recurrence, + &arriving(10_000.0), + &illustrative_calibration(), + ) + .unwrap() + .per_node[&chain]; + let kept = 6 * 10_000 * state_bytes; + assert!( + close(with_memory.cost - work.cost, 1.25e-7 * kept as f64), + "{with_memory:?}" + ); + assert!(with_memory.detail.contains(&format!("keeps {kept} bytes"))); + } + + /// The latency check (S6, sketch-bench cost model §5): a query's + /// latency is its query-time work on one core. Rebuilding the panes at + /// query time (B2) takes longer than merging the maintained ones (B1); + /// with a bound between the two, B2 is rejected as invalid with its + /// latency and B1 is selected. + #[test] + fn a_candidate_over_a_querys_latency_bound_is_rejected_with_its_latency() { + let candidates = pane_candidates(10_000.0); + let latency = |c: &PhysicalCandidate| { + let cost = price( + &c.dag, + &[repeating(MINUTE)], + &arriving(10_000.0), + &illustrative_calibration(), + ) + .unwrap(); + cost.latency[0] + }; + let (b2, b1) = (latency(&candidates[0]), latency(&candidates[1])); + assert_eq!((b2.compaction_ms, b1.compaction_ms), (0.0, 0.0)); + assert!(b1.query_ms < b2.query_ms, "{b1:?} vs {b2:?}"); + let bound = (b1.query_ms + b2.query_ms) / 2.0; + let demand = QueryDemand { + response_latency: LatencyRequirement::ExplicitMaxMs(bound), + ..every_minute() + }; + let selection = select_plan( + &candidates, + &[None], + &[demand], + &arriving(10_000.0), + PlanningModels::builtin(), + ) + .unwrap(); + assert_eq!(selection.selected, candidates[1].id); + let rejected = &selection.rejected[0]; + assert_eq!(rejected.id, candidates[0].id); + assert!(!rejected.valid); + assert!( + rejected.reason.starts_with(&format!( + "q1: latency {:.1} ms per evaluation (compaction 0.0 ms + query", + b2.total_ms() + )) && rejected + .reason + .ends_with(&format!("is over its {bound} ms bound")), + "{}", + rejected.reason + ); + assert!(!selection.costs.contains_key(&candidates[0].id)); + } + + /// When a maintained state's ingestion work needs more than one core, + /// its `k` workers' partial copies of the newest window are merged + /// before the query reads it: `(k − 1)` merges of one operation for + /// each of its states per window, on the query's chain. + #[test] + fn ingestion_work_over_one_core_adds_the_newest_windows_compaction() { + let latency = |rows_per_s: f64| { + let candidates = pane_candidates(rows_per_s); + price( + &candidates[1].dag, + &[repeating(MINUTE)], + &arriving(rows_per_s), + &illustrative_calibration(), + ) + .unwrap() + .latency[0] + }; + assert_eq!(latency(10_000.0).compaction_ms, 0.0); + let fast = latency(1e10); + // 10,000 series, one state each per window, 1 ns per merge. + let merges = fast.compaction_ms / (10_000.0 * 1e-6); + assert!( + merges >= 1.0 && (merges - merges.round()).abs() < 1e-6, + "{fast:?}" + ); + } } diff --git a/crates/asap-aware-mapping/src/test_support.rs b/crates/asap-aware-mapping/src/test_support.rs index 41dbc1844..3fbf66e7a 100644 --- a/crates/asap-aware-mapping/src/test_support.rs +++ b/crates/asap-aware-mapping/src/test_support.rs @@ -221,7 +221,7 @@ pub(crate) fn cms_summary(query: &str) -> OperatorNode { let run = crate::pass::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], &[Some(target)], - &[asap_types::workload::QueryRecurrence::Unknown], + &[asap_types::workload::QueryRecurrence::Unknown.into()], &DataWorkload::default(), crate::PlanningModels::builtin(), ) diff --git a/crates/asap-physical-operators/src/physical_planner/candidates.rs b/crates/asap-physical-operators/src/physical_planner/candidates.rs index bb3c1e343..9d667b248 100644 --- a/crates/asap-physical-operators/src/physical_planner/candidates.rs +++ b/crates/asap-physical-operators/src/physical_planner/candidates.rs @@ -379,7 +379,7 @@ mod tests { let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, planner_types::ir::QueryRoot::Operator(root))], &[Some(planner_types::types::AccuracyTarget::exact())], - &[planner_types::workload::QueryRecurrence::Unknown], + &[planner_types::workload::QueryRecurrence::Unknown.into()], &workload.data_workload.unwrap(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/asap-physical-operators/tests/common/mod.rs b/crates/asap-physical-operators/tests/common/mod.rs index d04894d4e..17ad94fae 100644 --- a/crates/asap-physical-operators/tests/common/mod.rs +++ b/crates/asap-physical-operators/tests/common/mod.rs @@ -71,7 +71,7 @@ fn run_stage1_to_stage3( asap_aware_mapping::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], &[Some(accuracy)], - &[planner_types::workload::QueryRecurrence::Unknown], + &[planner_types::workload::QueryRecurrence::Unknown.into()], &data, asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/devtools/src/bin/stage_pipeline.rs b/crates/devtools/src/bin/stage_pipeline.rs index c66ea0c93..e7d821e82 100644 --- a/crates/devtools/src/bin/stage_pipeline.rs +++ b/crates/devtools/src/bin/stage_pipeline.rs @@ -43,8 +43,9 @@ // // A workload with more than `--max-combinations` (default 10^4) Stage 1 // candidates, Pass 2's included, is refused as soon as enumeration passes -// the limit: the run exits with status 3 and the limit, and writes no -// document. +// the limit, and so is one whose Stage 2 physical candidates (one per +// materialization assignment, counted before they are built) pass it: the +// run exits with status 3 and the limit, and writes no document. // Planning never caps or truncates the candidates it ranks; only the display // does (`--max-displayed`). // @@ -67,6 +68,7 @@ use std::collections::HashSet; use asap_aware_mapping::stage3_plan_selection::{Rejection, Selection, SelectionError}; +use asap_devtools::candidate_labels::candidate_labels; use asap_devtools::planner_layering_examples::{ declared, example1, example2, example2_catalog, pattern_a, pattern_b, PatternARecurrence, }; @@ -81,8 +83,8 @@ use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::types::{default_metric_for_root, AccuracyTarget, ErrorMetric}; use asap_types::workload::{ AccuracyRequirement, BatchEntry, DataArrival, DataWorkload, DurationMs, LatencyRequirement, - PlanningWorkload, Query, QueryLanguage, QueryRecurrence, QueryRequirements, QueryWorkload, - RepeatedDemand, SqlDialect, + PlanningWorkload, Query, QueryDemand, QueryLanguage, QueryRecurrence, QueryRequirements, + QueryWorkload, RepeatedDemand, SqlDialect, }; use serde_json::{json, Value}; @@ -155,9 +157,10 @@ fn document_of( "stage2_physical_asap_optimization": { "candidates": [], "pruned": [] }, "stage3_plan_selection": { "costs": {}, "selected": null, "rejected": [] }, })), - Err(error @ PlanningStagesError::TooManyCandidates { .. }) => { - Err(Failure::TooManyCandidates(error)) - } + Err( + error @ (PlanningStagesError::TooManyCandidates { .. } + | PlanningStagesError::TooManyPhysicalCandidates { .. }), + ) => Err(Failure::TooManyCandidates(error)), Err(error @ PlanningStagesError::Validation(_)) => Err(error.to_string().into()), } } @@ -249,7 +252,7 @@ fn run(args: Vec) -> Result<(), Failure> { }; let catalog = sql_catalog(&tables)?; let mut names = HashSet::new(); - let (mut described, mut roots, mut recurrence) = (Vec::new(), Vec::new(), Vec::new()); + let (mut described, mut roots, mut demand) = (Vec::new(), Vec::new(), Vec::new()); for (index, (language, text, name)) in queries.into_iter().enumerate() { let (name, defaulted) = match name { Some(name) => (name, false), @@ -272,7 +275,11 @@ fn run(args: Vec) -> Result<(), Failure> { QueryLanguage::PromQL => lower_promql_roots(&one)?, _ => lower_sql_roots(&one, &catalog)?, }); - recurrence.extend(one.query_workload.entries().map(|entry| entry.recurrence)); + demand.extend( + one.query_workload + .entries() + .map(|entry| QueryDemand::from(&entry)), + ); let mut query = workload_queries(&one).remove(0); query["id"] = json!(name); described.push(query); @@ -285,7 +292,7 @@ fn run(args: Vec) -> Result<(), Failure> { let result = run_planning_stages_over( roots.clone(), &targets, - &recurrence, + &demand, &data, Some(max_combinations), ); @@ -324,6 +331,8 @@ fn stage_pipeline(queries: Vec, run: &PlanningStagesRun, max_displayed: u .filter(|p| shown.contains(p.from_logical.as_str())) .map(|p| p.id.as_str()) .collect(); + // Labels are for this document only; planning never reads them. + let labels = candidate_labels(run); // A choice that composition cannot substitute yet is listed with its // error rather than ending the run. let candidates: Vec<_> = run @@ -332,10 +341,10 @@ fn stage_pipeline(queries: Vec, run: &PlanningStagesRun, max_displayed: u .filter(|c| shown.contains(c.id.as_str())) .map(|c| match &c.roots { Ok(roots) => { - json!({ "id": c.id, "display_name": c.display_name, "dag": export(roots) }) + json!({ "id": c.id, "display_name": labels[&c.id], "dag": export(roots) }) } Err(error) => { - json!({ "id": c.id, "display_name": c.display_name, "error": error.to_string() }) + json!({ "id": c.id, "display_name": labels[&c.id], "error": error.to_string() }) } }) .collect(); @@ -343,13 +352,13 @@ fn stage_pipeline(queries: Vec, run: &PlanningStagesRun, max_displayed: u .stage2_physical_asap_optimization .iter() .filter(|p| shown_physical.contains(p.id.as_str())) - .map(|p| json!({ "id": p.id, "from_logical": p.from_logical, "display_name": p.display_name, "dag": p.dag })) + .map(|p| json!({ "id": p.id, "from_logical": p.from_logical, "display_name": labels[&p.id], "dag": p.dag })) .collect(); let pruned: Vec<_> = run .stage2_pruned .iter() .filter(|p| shown.contains(p.from_logical.as_str())) - .map(|p| json!({ "from_logical": p.from_logical, "display_name": p.display_name, "reason": p.reason })) + .map(|p| json!({ "from_logical": p.from_logical, "display_name": labels[&p.from_logical], "reason": p.reason })) .collect(); json!({ "format": "asap-stage-pipeline/v1", diff --git a/crates/devtools/src/candidate_labels.rs b/crates/devtools/src/candidate_labels.rs new file mode 100644 index 000000000..7d296bac2 --- /dev/null +++ b/crates/devtools/src/candidate_labels.rs @@ -0,0 +1,266 @@ +//! Display labels for the planning stages' candidates, for the +//! `stage_pipeline` viewer document only. Planning never reads them: they +//! are pure functions of the candidates' planning data (the Pass 1 choice, +//! the Pass 2 rules applied and the materialization assignment). + +use std::collections::BTreeMap; +use std::rc::Rc; + +use asap_aware_mapping::pass::Pass2Candidate; +use asap_aware_mapping::per_computation_candidates::{ + ComputationCandidate, PerComputationCandidates, +}; +use asap_aware_mapping::stage2_physical_asap_optimization::PhysicalCandidate; +use asap_types::ir::{ASAPOp, Operator, OperatorNode, QueryRoot}; +use asap_types::post_asap::{FieldDataType, Materialization, SketchAlgorithm}; + +use crate::planning_stages::PlanningStagesRun; + +/// The label of every logical (`L`) and physical (`P`, `P-m`) +/// candidate of `run`, by id. +pub fn candidate_labels(run: &PlanningStagesRun) -> BTreeMap { + let pass2: BTreeMap<&str, &Pass2Candidate> = run + .stage1_pass2 + .iter() + .map(|p| (p.id.as_str(), p)) + .collect(); + let mut labels = BTreeMap::new(); + for candidate in &run.stage1_logical_asap_optimization { + let mut label = choice_label(&run.stage1_pass1_per_computation, &candidate.choice); + if let Some(p) = pass2.get(candidate.id.as_str()) { + label += &pass2_label(p); + } + labels.insert(candidate.id.clone(), label); + } + for candidate in &run.stage2_physical_asap_optimization { + let logical = labels + .get(&candidate.from_logical) + .cloned() + .unwrap_or_default(); + labels.insert(candidate.id.clone(), physical_label(&logical, candidate)); + } + labels +} + +/// A Pass 1 choice, e.g. "Q1 exact · Q2 CMS+heap" (exact accumulators in +/// parentheses), each target listed under the first query that reads it. +pub fn choice_label(inventory: &PerComputationCandidates, choice: &[usize]) -> String { + let query_of_target: Vec = inventory + .targets + .iter() + .map(|target| { + inventory + .roots + .iter() + .position(|(_, root)| { + root_operators(root).into_iter().any(|node| { + OperatorNode::reachable(node) + .iter() + .any(|n| Rc::ptr_eq(n, &target.target)) + }) + }) + .expect("every target is reached from a root") + }) + .collect(); + // Targets a chosen whole-expression candidate absorbs are not computed. + let absorbed: Vec = inventory + .targets + .iter() + .zip(choice) + .filter(|(target, &index)| target.choices.candidates[index].absorbs_inner()) + .filter_map(|(target, _)| target.absorbs) + .collect(); + (0..inventory.roots.len()) + .map(|query| { + let mut sketches = Vec::new(); + let mut accumulators = Vec::new(); + for (t, (target, (&target_query, &index))) in inventory + .targets + .iter() + .zip(query_of_target.iter().zip(choice)) + .enumerate() + { + if target_query != query || absorbed.contains(&t) { + continue; + } + match &target.choices.candidates[index] { + ComputationCandidate::Exact => {} + ComputationCandidate::ExactAccumulator { kind, .. } => { + accumulators.push(format!("{kind:?} acc")) + } + ComputationCandidate::AvgAsSumCount => { + accumulators.push("Sum/Count acc".into()) + } + ComputationCandidate::NestedSumMerge => { + accumulators.push("nested Sum acc".into()) + } + ComputationCandidate::Summary(algorithm) + | ComputationCandidate::WholeExpression(algorithm) => { + sketches.push(sketch_name(algorithm)) + } + } + } + let mut text = format!("Q{} ", query + 1); + text += &if sketches.is_empty() { + "exact".to_string() + } else { + sketches.join(" + ") + }; + if !accumulators.is_empty() { + text += &format!(" ({})", accumulators.join(", ")); + } + text + }) + .collect::>() + .join(" · ") +} + +/// What a Pass 2 candidate adds to its Pass 1 candidate's label, e.g. +/// " · one UnivMon for Q1, Q3 · Kll for Q1 in 5 × 1m panes · Q2 rolled up +/// from Q1 · shared Scan". +pub fn pass2_label(pass2: &Pass2Candidate) -> String { + let mut label = String::new(); + if !pass2.summaries.is_empty() { + label += &format!(" · one {}", pass2.summaries.join(", one ")); + } + if !pass2.panes.is_empty() { + label += &format!(" · {}", pass2.panes.join(", ")); + } + if !pass2.reused.is_empty() { + label += &format!(" · {}", pass2.reused.join(", ")); + } + if !pass2.shared.is_empty() { + label += &format!(" · shared {}", pass2.shared.join(", ")); + } + label +} + +/// `logical` followed by what the candidate materializes, e.g. +/// "… · ingestion time: Kll ×5 panes · query time, shared: DDSketch"; +/// just `logical` when nothing is. +pub fn physical_label(logical: &str, candidate: &PhysicalCandidate) -> String { + let mut parts: Vec<(&str, Vec)> = Vec::new(); + for (id, materialization) in &candidate.materialization { + let phase = match materialization { + Materialization::NotMaterialized => continue, + Materialization::MatAtIngestion(_) => "ingestion time", + Materialization::MatAtQuery(_) => "query time, shared", + }; + let node = candidate + .dag + .nodes + .iter() + .find(|n| n.id == *id) + .expect("an assigned node is in the DAG"); + let label = build_label(&node.payload); + match parts.iter_mut().find(|(p, _)| *p == phase) { + Some((_, labels)) => labels.push(label), + None => parts.push((phase, vec![label])), + } + } + std::iter::once(logical.to_string()) + .chain( + parts + .into_iter() + .map(|(phase, labels)| format!("{phase}: {}", labels.join(", "))), + ) + .collect::>() + .join(" · ") +} + +/// A summary build, e.g. "Kll ×5 panes" or "Sum acc". +fn build_label(payload: &Operator) -> String { + let Operator::ASAP(op) = payload else { + return payload.kind_name().to_string(); + }; + let state = match op { + ASAPOp::SummaryAgg { family, .. } | ASAPOp::PaneChain { family, .. } => match family { + FieldDataType::Sketch(kind, _) => sketch_name(kind.algorithm()), + FieldDataType::ExactAggregate(kind, _) => format!("{kind:?} acc"), + _ => payload.kind_name().to_string(), + }, + _ => payload.kind_name().to_string(), + }; + match op { + ASAPOp::PaneChain { pane_count, .. } => format!("{state} ×{pane_count} panes"), + _ => state, + } +} + +/// A sketch algorithm's display name, e.g. "CMS+heap" or "Kll". +fn sketch_name(algorithm: &SketchAlgorithm) -> String { + match algorithm { + SketchAlgorithm::CmsWithHeap => "CMS+heap".to_string(), + SketchAlgorithm::CountSketchWithHeap => "CountSketch+heap".to_string(), + other => format!("{other:?}"), + } +} + +fn root_operators(root: &QueryRoot) -> Vec<&Rc> { + match root { + QueryRoot::Operator(node) => vec![node], + QueryRoot::Scalar(expr) => expr.operator_refs(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::planner_layering_examples::{example1, example2, example2_catalog}; + use crate::planning_stages::{lower_promql_roots, lower_sql_roots, run_planning_stages}; + + /// Logical labels name each query's choice and the Pass 2 rules applied; + /// a physical label adds what it materializes, and with nothing + /// materialized it is its logical candidate's label. + #[test] + fn example1_labels_name_choices_rules_and_materialization() { + let workload = example1(); + let run = + run_planning_stages(&workload, lower_promql_roots(&workload).unwrap(), None).unwrap(); + let labels = candidate_labels(&run); + assert_eq!( + labels["L1"], + "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc)" + ); + assert!(labels.values().any(|l| l.ends_with(" · shared Scan #1"))); + assert!(labels + .values() + .any(|l| l.contains("Rate acc for Q1 in 6 × 10s panes"))); + for p in &run.stage2_physical_asap_optimization { + let label = &labels[&p.id]; + assert!(label.starts_with(&labels[&p.from_logical]), "{label}"); + assert_eq!( + p.materializes_any(), + label != &labels[&p.from_logical], + "{label}" + ); + } + assert!(labels + .values() + .any(|l| l.ends_with(" · ingestion time: Rate acc ×6 panes"))); + assert!(labels + .values() + .any(|l| l.ends_with(" · ingestion time: Sum acc ×6 panes"))); + } + + /// A summary build read by two queries can be built once per evaluation + /// for both: its label says "query time, shared". + #[test] + fn example2_labels_name_builds_shared_at_query_time() { + let workload = example2(); + let roots = lower_sql_roots(&workload, &example2_catalog()).unwrap(); + let run = run_planning_stages(&workload, roots, None).unwrap(); + let labels = candidate_labels(&run); + assert!( + labels + .values() + .any(|l| l.contains(" · query time, shared: UnivMon")), + "{:?}", + labels + .values() + .filter(|l| l.contains("query time")) + .take(3) + .collect::>() + ); + } +} diff --git a/crates/devtools/src/lib.rs b/crates/devtools/src/lib.rs index 3a44b6cee..346f1d84c 100644 --- a/crates/devtools/src/lib.rs +++ b/crates/devtools/src/lib.rs @@ -14,8 +14,10 @@ //! //! [`planning_stages`] and [`planner_layering_examples`] hold the one //! pipeline and the #509 example workloads that `stage_pipeline` and the -//! planner-layering acceptance tests share. +//! planner-layering acceptance tests share; [`candidate_labels`] names the +//! candidates for the viewer document. +pub mod candidate_labels; pub mod planner_layering_examples; pub mod planning_stages; diff --git a/crates/devtools/src/planning_stages.rs b/crates/devtools/src/planning_stages.rs index e29b5a17d..dcf9cdef4 100644 --- a/crates/devtools/src/planning_stages.rs +++ b/crates/devtools/src/planning_stages.rs @@ -3,20 +3,28 @@ //! tests, so both see the same candidates, ids and selection. use asap_aware_mapping::pass::{run_stage2_and_stage3, stage1_logical_asap_optimization}; -pub use asap_aware_mapping::pass::{LogicalCandidate, PrunedCandidate}; +pub use asap_aware_mapping::pass::{LogicalCandidate, Pass2Candidate, PrunedCandidate}; use asap_aware_mapping::per_computation_candidates::generate_per_computation_candidates; -use asap_aware_mapping::stage2_physical_asap_optimization::PhysicalCandidate; +use asap_aware_mapping::per_computation_candidates::PerComputationCandidates; +use asap_aware_mapping::stage2_physical_asap_optimization::{ + physical_candidate_count, PhysicalCandidate, +}; use asap_aware_mapping::stage3_plan_selection::{Selection, SelectionError}; use asap_aware_mapping::PlanningModels; use asap_types::ir::schema_support::with_promql_series_identity; use asap_types::ir::QueryRoot; use asap_types::types::AccuracyTarget; -use asap_types::workload::{DataWorkload, PlanningWorkload, QueryRecurrence}; +use asap_types::workload::{DataWorkload, PlanningWorkload, QueryDemand}; #[derive(Debug)] pub struct PlanningStagesRun { /// The query-language frontends' roots, one per workload entry. pub stage0_query_language_frontends: Vec, + /// Stage 1, Pass 1: the per-computation candidates the logical + /// candidates' `choice` indexes (query `i` has id `i`). + pub stage1_pass1_per_computation: PerComputationCandidates, + /// Stage 1, Pass 2: the rules each Pass 2 candidate applied. + pub stage1_pass2: Vec, pub stage1_logical_asap_optimization: Vec, /// `P` implements `L`. pub stage2_physical_asap_optimization: Vec, @@ -77,6 +85,11 @@ pub enum PlanningStagesError { /// Stage 1 enumerated more candidates (Pass 1's and Pass 2's) than the /// caller's limit; enumeration stopped there and nothing was planned. TooManyCandidates { limit: usize }, + /// Stage 2 would build more physical candidates (one per + /// materialization assignment of each Stage 1 candidate) than the + /// caller's limit; they were counted, not built, and nothing was + /// planned. + TooManyPhysicalCandidates { limit: usize }, /// The frontends' roots or a composed candidate failed validation. Validation(String), } @@ -89,6 +102,11 @@ impl std::fmt::Display for PlanningStagesError { f, "workload has more than {limit} Stage 1 candidates, Pass 2's included; \ planning it needs early pruning (#673)" + ), + Self::TooManyPhysicalCandidates { limit } => write!( + f, + "workload has more than {limit} Stage 2 physical candidates (materialization \ +options included); planning it needs early pruning (#673)" ), Self::Validation(error) => write!(f, "validation: {error}"), } @@ -113,8 +131,11 @@ impl From for String { /// that shows fewer cuts only its display. With `max_combinations`, Stage 1 /// candidates (Pass 2's included) are counted as they are enumerated, and a /// workload with more is refused as soon as the count passes the limit; the -/// library itself never caps. Plan selection reads the accuracy targets, -/// the recurrences and the data workload. The frontends' roots and every composed candidate are +/// library itself never caps. The same limit applies to Stage 2's physical +/// candidates, counted before they are built. Stage 2 reads the +/// recurrences, predictabilities and the data workload; plan selection the +/// accuracy targets, the recurrences, the latency bounds and the data +/// workload. The frontends' roots and every composed candidate are /// validated. pub fn run_planning_stages( workload: &PlanningWorkload, @@ -126,22 +147,22 @@ pub fn run_planning_stages( .entries() .map(|entry| entry.requirements.accuracy.requested()) .collect(); - let recurrence: Vec<_> = workload + let demand: Vec<_> = workload .query_workload .entries() - .map(|entry| entry.recurrence) + .map(|entry| QueryDemand::from(&entry)) .collect(); let data = workload.data_workload.clone().unwrap_or_default(); - run_planning_stages_over(roots, &targets, &recurrence, &data, max_combinations) + run_planning_stages_over(roots, &targets, &demand, &data, max_combinations) } /// [`run_planning_stages`] over roots lowered from any mix of query /// languages: query `i` is `roots[i]` with accuracy target `targets[i]`, -/// evaluated as `recurrence[i]` says. +/// demanded as `demand[i]` says. pub fn run_planning_stages_over( roots: Vec, targets: &[AccuracyTarget], - recurrence: &[QueryRecurrence], + demand: &[QueryDemand], data: &DataWorkload, max_combinations: Option, ) -> Result { @@ -152,8 +173,9 @@ pub fn run_planning_stages_over( .map_err(|e| PlanningStagesError::Pass1(e.to_string()))?; // Count Stage 1 candidates as they are enumerated and stop as soon as // the count passes the limit; never truncate. + let recurrence: Vec<_> = demand.iter().map(|d| d.recurrence.clone()).collect(); let mut stage1 = Vec::new(); - for candidate in stage1_logical_asap_optimization(&per_computation, recurrence) { + for candidate in stage1_logical_asap_optimization(&per_computation, &recurrence) { if max_combinations.is_some_and(|limit| stage1.len() == limit) { return Err(PlanningStagesError::TooManyCandidates { limit: stage1.len(), @@ -161,11 +183,20 @@ pub fn run_planning_stages_over( } stage1.push(candidate); } + if let Some(limit) = max_combinations { + let mut physical = 0usize; + for roots in stage1.iter().filter_map(|c| c.roots.as_ref().ok()) { + physical += physical_candidate_count(roots, demand, data).unwrap_or(0); + if physical > limit { + return Err(PlanningStagesError::TooManyPhysicalCandidates { limit }); + } + } + } let run = run_stage2_and_stage3( per_computation, stage1, &targets, - recurrence, + demand, data, PlanningModels::builtin(), ); @@ -176,6 +207,8 @@ pub fn run_planning_stages_over( } Ok(PlanningStagesRun { stage0_query_language_frontends: roots, + stage1_pass1_per_computation: run.stage1_pass1_per_computation, + stage1_pass2: run.stage1_pass2, stage1_logical_asap_optimization: run.stage1_logical_asap_optimization, stage2_physical_asap_optimization: run.stage2_physical_asap_optimization, stage2_pruned: run.stage2_pruned, diff --git a/crates/devtools/tests/stage_pipeline.rs b/crates/devtools/tests/stage_pipeline.rs index 037f977f0..4a84c3ba0 100644 --- a/crates/devtools/tests/stage_pipeline.rs +++ b/crates/devtools/tests/stage_pipeline.rs @@ -106,7 +106,14 @@ fn example1_document_is_valid_and_committed_fixture_is_current() { .chain(pruned) .map(|p| p["from_logical"].as_str().unwrap()) .collect(); - assert_eq!(physical.len() + pruned.len(), composed.len()); + // One physical candidate with nothing materialized per composed + // logical candidate, `P`, plus `P-m` for each other + // materialization assignment. + let unmaterialized = physical + .iter() + .filter(|p| !p["id"].as_str().unwrap().contains("-m")) + .count(); + assert_eq!(unmaterialized + pruned.len(), composed.len()); assert_eq!(sources, composed); for candidate in physical { assert!(candidate.get("cost").is_none(), "Stage 2 has no cost"); @@ -357,12 +364,35 @@ fn workload_above_the_candidate_limit_is_rejected() { "{stderr}" ); } + // At Stage 1's 27 candidates, Stage 2's 57 physical candidates (30 maintain + // pane chains at ingestion time) pass the limit; they are counted, not built. + let (status, stderr) = failure(&[ + "--example", + "planner-layering-1", + "--max-combinations", + "27", + ]); + assert_eq!(status, Some(3)); + assert!( + stderr.contains( + "workload has more than 27 Stage 2 physical candidates (materialization options \ + included); planning it needs early pruning (#673)" + ), + "{stderr}" + ); // At the limit, it plans every candidate. - let document = generate(&["--max-combinations", "27"]); + let document = generate(&["--max-combinations", "57"]); assert_eq!( document["stage1_logical_asap_optimization"]["combinations"], 27 ); + assert_eq!( + document["stage2_physical_asap_optimization"]["candidates"] + .as_array() + .unwrap() + .len(), + 57 + ); } /// The default limit is 10^4: nine approximate Top-K queries (3^9 = 19683 @@ -391,6 +421,7 @@ fn planning_stages_without_a_limit_plan_every_candidate() { let workload = example1(); let run = run_planning_stages(&workload, lower_promql_roots(&workload).unwrap(), None).unwrap(); assert_eq!(run.stage1_logical_asap_optimization.len(), 27); + assert_eq!(run.stage2_physical_asap_optimization.len(), 57); let limited = run_planning_stages(&workload, lower_promql_roots(&workload).unwrap(), Some(26)); assert!(matches!( limited, diff --git a/crates/frontend-promql/tests/support.rs b/crates/frontend-promql/tests/support.rs index d6b20bcab..8ec281958 100644 --- a/crates/frontend-promql/tests/support.rs +++ b/crates/frontend-promql/tests/support.rs @@ -120,7 +120,7 @@ pub fn run_stage1_to_stage3( asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(root))], &[Some(accuracy)], - &[asap_types::workload::QueryRecurrence::Unknown], + &[asap_types::workload::QueryRecurrence::Unknown.into()], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) @@ -172,7 +172,7 @@ pub fn logical_plan(root: &Rc) -> Result, String> let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(Rc::clone(root)))], &[None], - &[asap_types::workload::QueryRecurrence::Unknown], + &[asap_types::workload::QueryRecurrence::Unknown.into()], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/frontend-sql/tests/pearson_corr.rs b/crates/frontend-sql/tests/pearson_corr.rs index fb73072d0..ca569ba85 100644 --- a/crates/frontend-sql/tests/pearson_corr.rs +++ b/crates/frontend-sql/tests/pearson_corr.rs @@ -151,7 +151,7 @@ async fn corr_survives_exact_plan_compilation() { let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(query.clone()))], &[Some(asap_types::types::AccuracyTarget::exact())], - &[asap_types::workload::QueryRecurrence::Unknown], + &[asap_types::workload::QueryRecurrence::Unknown.into()], &Default::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/integration-tests/src/lib.rs b/crates/integration-tests/src/lib.rs index 435730358..b84e9d630 100644 --- a/crates/integration-tests/src/lib.rs +++ b/crates/integration-tests/src/lib.rs @@ -158,7 +158,7 @@ pub mod planning { asap_aware_mapping::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], &[Some(accuracy)], - &[asap_types::workload::QueryRecurrence::Unknown], + &[asap_types::workload::QueryRecurrence::Unknown.into()], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/integration-tests/tests/operator_design_examples.rs b/crates/integration-tests/tests/operator_design_examples.rs index 4eeaeab41..f0a203e4a 100644 --- a/crates/integration-tests/tests/operator_design_examples.rs +++ b/crates/integration-tests/tests/operator_design_examples.rs @@ -255,9 +255,10 @@ async fn sql_window_and_filtered_aggregate_types() { } /// A real query batch replaces each SUM by its exact accumulator state, -/// retains two result roots, and executes both selected plans. Each query -/// reads its own state until Pass 2 shares identical producers (#580). No -/// replacement dag is constructed by the test. +/// retains two result roots, and executes both selected plans. Pass 2 +/// shares the identical state, and building it once per evaluation for both +/// queries (`MatAtQuery`) is the cheapest plan, so both roots read one +/// state. No replacement dag is constructed by the test. #[tokio::test] async fn batch_planning_replaces_summary_operators() { use asap_aware_mapping::pass::PlanningModels; @@ -317,8 +318,14 @@ async fn batch_planning_replaces_summary_operators() { .into_iter() .filter(|n| matches!(n.asap(), Some(ASAPOp::SummaryAgg { .. }))) .collect(); - assert_eq!(states.len(), 2, "one SUM state per query"); - for ((plan, expected), state) in output.plans.iter().zip([31.0, 60.0]).zip(&states) { + let [state] = &states[..] else { + panic!("one SUM state for both queries: {states:?}") + }; + assert!(matches!( + state.materialization, + asap_types::ir::Materialization::MatAtQuery(_) + )); + for (plan, expected) in output.plans.iter().zip([31.0, 60.0]) { let root = &plan.root; root.validate_structure().unwrap(); assert!(OperatorNode::reachable(root) @@ -367,22 +374,28 @@ async fn batch_planning_replaces_summary_operators() { rows ); } - // The batch exports as one physical DAG: a root per query and each - // query's SUM state. + // The batch exports as one physical DAG: a root per query and the one + // SUM state, with the materialization the selected plan assigned it. let workload_dag = output.execution_timed_dag().unwrap(); assert_eq!(workload_dag.roots.len(), 2); assert_ne!(workload_dag.roots[0], workload_dag.roots[1]); - assert_eq!( - workload_dag - .nodes - .iter() - .filter(|n| matches!( + let states: Vec<_> = workload_dag + .nodes + .iter() + .filter(|n| { + matches!( n.payload, asap_types::ir::physical_export::PhysicalASAPOperatorPayload::ASAP( asap_types::ir::ASAPOp::SummaryAgg { .. } ) - )) - .count(), - 2 - ); + ) + }) + .collect(); + let [state] = &states[..] else { + panic!("one SUM state: {states:?}") + }; + assert!(matches!( + state.materialization, + asap_types::ir::Materialization::MatAtQuery(_) + )); } diff --git a/crates/integration-tests/tests/planner_layering_common/mod.rs b/crates/integration-tests/tests/planner_layering_common/mod.rs index 02a496750..e881f4ff3 100644 --- a/crates/integration-tests/tests/planner_layering_common/mod.rs +++ b/crates/integration-tests/tests/planner_layering_common/mod.rs @@ -6,7 +6,8 @@ //! `asap_devtools::planning_stages::run_planning_stages`, the pipeline //! `stage_pipeline` also runs; the example workloads come from //! `asap_devtools::planner_layering_examples`. The functions under "Pending adapters" read properties the IR -//! cannot express yet (sliding and EH window summaries, retention). They return today's +//! cannot express yet (sliding and EH window summaries) or derive what it +//! does not record (retention). They return today's //! only possible answer; the implementer of each feature replaces the body //! with a read of the new IR. Tests that depend on them are `#[ignore]`d //! with the feature. @@ -19,7 +20,7 @@ use asap_aware_mapping::stage3_plan_selection::Selection; use asap_devtools::planning_stages::{lower_promql_roots, run_planning_stages}; use asap_types::ir::flat::{flatten, FlatDag, NodeId}; use asap_types::ir::physical_export::PhysicalASAPDAG; -use asap_types::ir::{ASAPOp, Operator, QueryRoot}; +use asap_types::ir::{ASAPOp, NonASAPOp, Operator, QueryRoot}; use asap_types::post_asap::{ FieldDataType, Materialization, SketchAlgorithm, SketchParams, SketchStatistic, }; @@ -77,8 +78,6 @@ pub fn operation(payload: &Payload) -> String { #[derive(Debug, Clone)] pub struct Logical { pub id: String, - /// The choice of a per-computation candidate for every Pass 1 target. - pub display_name: String, pub dag: FlatDag, pub query_roots: Vec, pub roots: Vec, @@ -144,7 +143,7 @@ impl Run { } } -fn logical(id: String, display_name: String, roots: Vec) -> Logical { +fn logical(id: String, roots: Vec) -> Logical { let dag = flatten(&roots).0; let query_roots = dag .roots @@ -156,7 +155,6 @@ fn logical(id: String, display_name: String, roots: Vec) -> Logical { .collect(); Logical { id, - display_name, dag, query_roots, roots, @@ -165,18 +163,17 @@ fn logical(id: String, display_name: String, roots: Vec) -> Logical { /// Every stage over `roots`, the lowered entries of `workload`, with every /// logical candidate. Every candidate of the examples composes and -/// plan selection selects one. Recurrence and predictability (which -/// materialization needs, Example 4) are not passed to plan selection. +/// plan selection selects one. Physical ASAP-aware optimization reads each +/// entry's recurrence and predictability and the data arrival (Example 4); +/// plan selection also reads the latency bounds. pub fn run_stages(workload: &PlanningWorkload, roots: Vec) -> Run { let run = run_planning_stages(workload, roots, None).expect("planning stages run"); let logical_candidates = run .stage1_logical_asap_optimization .into_iter() .map(|c| { - let roots = c - .roots - .unwrap_or_else(|e| panic!("{} ({}) composes: {e}", c.id, c.display_name)); - logical(c.id, c.display_name, roots) + let roots = c.roots.unwrap_or_else(|e| panic!("{} composes: {e}", c.id)); + logical(c.id, roots) }) .collect(); let physical = run @@ -192,7 +189,6 @@ pub fn run_stages(workload: &PlanningWorkload, roots: Vec) -> Run { Run { stage0_query_language_frontends: logical( "stage0-query-language-frontends".into(), - "query-language frontends".into(), run.stage0_query_language_frontends, ), logical: logical_candidates, @@ -404,22 +400,50 @@ pub fn assert_valid_and_uniquely_named(run: &Run) { } } -/// Physical ASAP-aware optimization maps the logical candidates one-to-one -/// onto physical ones, so no candidate is discarded before plan selection. -pub fn assert_one_physical_candidate_per_logical(run: &Run) { +/// No candidate is discarded before plan selection: physical ASAP-aware +/// optimization gives each logical candidate `L` exactly one physical +/// candidate with nothing materialized, `P`, and one `P-m` for each +/// other materialization assignment. +pub fn assert_one_unmaterialized_physical_candidate_per_logical(run: &Run) { assert!(run.pruned.is_empty(), "pruned: {:?}", run.pruned); - let sources: BTreeSet<_> = run + let unmaterialized: Vec<_> = run .physical + .iter() + .filter(|p| !p.id.contains("-m")) + .collect(); + let sources: BTreeSet<_> = unmaterialized .iter() .map(|p| p.from_logical.as_str()) .collect(); let logical: BTreeSet<_> = run.logical.iter().map(|c| c.id.as_str()).collect(); assert_eq!(sources, logical); - assert_eq!(run.physical.len(), run.logical.len()); + assert_eq!(unmaterialized.len(), run.logical.len()); + for p in &run.physical { + let base = p.id.split("-m").next().unwrap(); + assert_eq!(&base[1..], &p.from_logical[1..], "{}", p.id); + let unmaterialized = !p.id.contains("-m"); + assert_eq!(unmaterialized, !p.candidate.materializes_any(), "{}", p.id); + if unmaterialized { + for n in &p.dag().nodes { + assert_eq!( + materialization(p, n.id), + MaterializationOption::NotMaterialized + ); + } + } + } let ids: BTreeSet<_> = run.physical.iter().map(|p| p.id.as_str()).collect(); assert_eq!(ids.len(), run.physical.len(), "unique physical ids"); } +/// The physical candidates with nothing materialized, one per logical +/// candidate. +pub fn unmaterialized(run: &Run) -> impl Iterator { + run.physical + .iter() + .filter(|p| !p.candidate.materializes_any()) +} + /// One selected id; every other candidate rejected once, with a reason. pub fn assert_selects_one_and_explains_the_rest(run: &Run) { let all: BTreeSet<_> = run.physical.iter().map(|p| p.id.clone()).collect(); @@ -622,8 +646,48 @@ pub fn window_form(dag: &impl ExportedDag, build: NodeId) -> WindowForm { } } -/// Pending (needs retention in the physical DAG): how long a materialized -/// node's output is kept, in event time. `None` until the IR records it. -pub fn retention_ms(_p: &Physical, _node: NodeId) -> Option { - None +/// How far back from an evaluation a materialized node's kept output +/// reaches in event time, derived the way plan selection prices what it +/// keeps (the IR does not record retention): a pane chain keeps its `N` +/// panes of width `w`, plus the one being built when maintained at +/// ingestion time; a whole-window build keeps its window, and the next one +/// being built at ingestion time; each plus the offset of the time shifts +/// below it. `None` for any other node. +pub fn retention_ms(p: &Physical, node: NodeId) -> Option { + let dag = p.dag(); + let at_ingestion = runs_at_ingestion(p, node); + let below = |id: NodeId| dag.producers(id).into_iter().next(); + let offset_below = |mut id: Option| { + let mut offset = 0u64; + while let Some(at) = id { + match dag.payload(at) { + Operator::NonASAP(NonASAPOp::TimeShift { shift, .. }) => { + offset += shift.offset_ms.unsigned_abs() + } + Operator::NonASAP(NonASAPOp::Scan { .. }) => break, + _ => {} + } + id = below(at); + } + offset + }; + match dag.payload(node) { + Operator::ASAP(ASAPOp::PaneChain { + pane_width_ms, + pane_count, + .. + }) => { + let panes = u64::from(*pane_count) + u64::from(at_ingestion); + Some(panes * pane_width_ms + offset_below(below(node))) + } + Operator::ASAP(ASAPOp::SummaryAgg { .. }) => { + let child = below(node)?; + let Operator::NonASAP(NonASAPOp::TimeRange { range, .. }) = dag.payload(child) else { + return None; + }; + let windows = 1 + u64::from(at_ingestion); + Some(windows * range.as_millis() as u64 + offset_below(below(child))) + } + _ => None, + } } diff --git a/crates/integration-tests/tests/planner_layering_example1.rs b/crates/integration-tests/tests/planner_layering_example1.rs index ed9c8e2cf..28fcf291c 100644 --- a/crates/integration-tests/tests/planner_layering_example1.rs +++ b/crates/integration-tests/tests/planner_layering_example1.rs @@ -358,33 +358,33 @@ fn stage1_logical_asap_optimization_candidates_are_valid_and_uniquely_named() { // ── Physical ASAP-aware optimization ───────────────────────────────────── -/// No candidate is discarded before plan selection: the logical candidates -/// map one-to-one, 3 of them without a shared input or tumbling panes. +/// No candidate is discarded before plan selection: each logical candidate +/// keeps one physical candidate with nothing materialized, 3 of them +/// without a shared input or tumbling panes. #[test] fn stage2_physical_asap_optimization_keeps_every_logical_candidate() { let run = pipeline(); - assert_one_physical_candidate_per_logical(&run); - let unshared = run - .physical - .iter() + assert_one_unmaterialized_physical_candidate_per_logical(&run); + let unshared = unmaterialized(&run) .filter(|p| whole_windows(p.dag()) && !classify(p.dag(), &p.query_roots).1) .count(); assert_eq!(unshared, 3); } -/// Each physical candidate keeps its logical Q2 option and input sharing. +/// Each physical candidate keeps its logical Q2 option, and one with +/// nothing materialized keeps its input sharing. Maintaining Q2's panes at +/// ingestion time splits a scan Q1 reads at query time, one copy per phase. #[test] fn stage2_physical_asap_optimization_preserves_logical_choices() { let run = pipeline(); for p in &run.physical { let source = run.logical.iter().find(|c| c.id == p.from_logical).unwrap(); - assert_eq!( - classify(p.dag(), &p.query_roots), - classify(&source.dag, &source.query_roots), - "{} vs {}", - p.id, - source.id - ); + let (option, shared) = classify(p.dag(), &p.query_roots); + let (logical_option, logical_shared) = classify(&source.dag, &source.query_roots); + assert_eq!(option, logical_option, "{} vs {}", p.id, source.id); + if !p.candidate.materializes_any() { + assert_eq!(shared, logical_shared, "{} vs {}", p.id, source.id); + } } } @@ -472,22 +472,57 @@ fn stage2_physical_asap_optimization_summary_topk_is_build_then_estimate() { } } -/// Every sub-DAG is NotMaterialized, so every node runs at query time. +/// Only tumbling panes can be maintained at ingestion time: the +/// whole-window builds' fixed interval has no phase, and no summary is read +/// by both queries. Q1's rate panes are counter states, which need each +/// series' samples in time order; continuously ingesting PromQL data is +/// taken to arrive in that order, so they are maintained too. Each pane +/// chain is maintained or not independently: a logical candidate with `c` +/// chains has `2^c` physical candidates. #[test] -fn stage2_physical_asap_optimization_nothing_is_materialized() { +fn stage2_physical_asap_optimization_materializes_only_panes_at_ingestion() { let run = pipeline(); + let mut counter_maintained = 0; for p in &run.physical { for n in &p.dag().nodes { - assert_eq!( - materialization(p, n.id), - MaterializationOption::NotMaterialized, - "{}: {:?}", - p.id, - n.id - ); - assert!(!runs_at_ingestion(p, n.id), "{}: {:?}", p.id, n.id); + match materialization(p, n.id) { + MaterializationOption::NotMaterialized => {} + MaterializationOption::MatAtIngestion => { + let Operator::ASAP(ASAPOp::PaneChain { family, .. }) = p.dag().payload(n.id) + else { + panic!("{}: {:?} is not a pane chain", p.id, n.id) + }; + if matches!( + family, + FieldDataType::ExactAggregate( + asap_types::post_asap::ExactKind::Rate + | asap_types::post_asap::ExactKind::Increase, + _ + ) + ) { + counter_maintained += 1; + } + } + other => panic!("{}: {:?} is {other:?}", p.id, n.id), + } } } + assert!(counter_maintained > 0, "Q1's rate panes are maintained"); + let expected: usize = run + .logical + .iter() + .map(|c| { + let chains = c + .dag + .node_ids() + .into_iter() + .filter(|&id| matches!(c.dag.payload(id), Operator::ASAP(ASAPOp::PaneChain { .. }))) + .count(); + 1 << chains + }) + .sum(); + assert_eq!(run.physical.len(), expected); + assert_eq!(run.physical.len(), 57); } /// Compile `p` in the physical planner (the runtime capability check), with @@ -514,7 +549,7 @@ fn compile_in_runtime(p: &Physical) -> Result<(), String> { let roots: Vec = dag.roots.iter().map(|&id| id as u64).collect(); compile(dag, inputs, &roots) .map(|_| ()) - .map_err(|e| format!("{} ({}): {e}", p.id, p.candidate.display_name)) + .map_err(|e| format!("{}: {e}", p.id)) } /// Runtime capability check (added by the implementer, not part of the @@ -694,7 +729,7 @@ fn materialized_case() -> Run { let selection = select_plan( std::slice::from_ref(&p.candidate), &[Some(AccuracyTarget::exact()), Some(AccuracyTarget::exact())], - &[every_10s(), every_10s()], + &[every_10s().into(), every_10s().into()], workload.data_workload.as_ref().unwrap(), PlanningModels::builtin(), ) diff --git a/crates/integration-tests/tests/planner_layering_example2.rs b/crates/integration-tests/tests/planner_layering_example2.rs index 265f4bbb1..623944a94 100644 --- a/crates/integration-tests/tests/planner_layering_example2.rs +++ b/crates/integration-tests/tests/planner_layering_example2.rs @@ -496,10 +496,10 @@ fn stage1_logical_asap_optimization_candidates_are_valid_and_uniquely_named() { // ── Physical ASAP-aware optimization ───────────────────────────────────── -/// No candidate is discarded before plan selection: logical candidates map one-to-one onto physical ones. +/// No candidate is discarded before plan selection: each logical candidate keeps one physical candidate with nothing materialized, plus one per other materialization assignment. #[test] fn stage2_physical_asap_optimization_keeps_every_logical_candidate() { - assert_one_physical_candidate_per_logical(&pipeline()); + assert_one_unmaterialized_physical_candidate_per_logical(&pipeline()); } /// Physical ASAP-aware optimization keeps the shared UnivMon as one build node read by all three queries. @@ -954,11 +954,14 @@ fn stage3_plan_selection_selected_kmv_plan_executes_end_to_end() { .iter() .map(|e| Some(e.requirements.accuracy.requested())) .collect(); - let recurrence: Vec<_> = entries.iter().map(|e| e.recurrence.clone()).collect(); + let demand: Vec<_> = entries + .iter() + .map(asap_types::workload::QueryDemand::from) + .collect(); let selection = select_plan( &kmv, &targets, - &recurrence, + &demand, workload.data_workload.as_ref().unwrap(), PlanningModels::builtin(), ) diff --git a/crates/integration-tests/tests/planner_layering_example4.rs b/crates/integration-tests/tests/planner_layering_example4.rs index ef0db7346..fcbbb32f4 100644 --- a/crates/integration-tests/tests/planner_layering_example4.rs +++ b/crates/integration-tests/tests/planner_layering_example4.rs @@ -164,7 +164,7 @@ fn stage2_physical_asap_optimization_materialized_output_covers_its_consumers() /// The shared EH candidate yields A1 (query time, kept), A2 (ingestion time) and A3 (not materialized). #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage2_physical_asap_optimization_a_shared_eh_has_three_materialization_options() { let found: BTreeSet<_> = eh_options(&run_promql(&once())).into_keys().collect(); assert_eq!( @@ -175,7 +175,7 @@ fn stage2_physical_asap_optimization_a_shared_eh_has_three_materialization_optio /// With data at rest, A2 is not generated; A1 and A3 remain. #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage2_physical_asap_optimization_a_at_rest_drops_the_ingestion_time_option() { let found: BTreeSet<_> = eh_options(&run_promql(&at_rest())).into_keys().collect(); assert_eq!(found, BTreeSet::from([MatAtQuery, NotMaterialized])); @@ -183,7 +183,7 @@ fn stage2_physical_asap_optimization_a_at_rest_drops_the_ingestion_time_option() /// A materialized shared EH is one build node read by all five queries, charged once. #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage2_physical_asap_optimization_a_materialized_eh_is_built_once_for_all_consumers() { let run = run_promql(&once()); for (m, (id, build)) in eh_options(&run) { @@ -213,7 +213,7 @@ fn stage2_physical_asap_optimization_a_materialized_eh_is_built_once_for_all_con /// `NotMaterialized` node once per consuming query), so it costs more than A1, /// which builds it once. #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage3_plan_selection_a_rebuilding_per_query_costs_more_than_building_once() { let run = run_promql(&once()); let options = eh_options(&run); @@ -228,7 +228,7 @@ fn stage3_plan_selection_a_rebuilding_per_query_costs_more_than_building_once() /// As given (run once, ad hoc), A1 is the cheapest of the three: A2 maintains years of history for one batch. #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage3_plan_selection_a_once_adhoc_prefers_the_query_time_eh() { let run = run_promql(&once()); let options = eh_options(&run); @@ -240,7 +240,7 @@ fn stage3_plan_selection_a_once_adhoc_prefers_the_query_time_eh() { /// Repeated monthly and predictable, A2's maintenance is shared by many batches, so A2 gains on A1. #[test] -#[ignore = "needs Pass 2 window segments shared across queries (#628, #634), materialization enumeration (#604) and MatAtQuery (#625)"] +#[ignore = "needs Pass 2 window segments shared across queries (#628, #634); Stage 2 materialization (MatAtQuery within one batch) is in place"] fn stage3_plan_selection_a_monthly_amortizes_ingestion_time_maintenance() { let ratio = |workload: PlanningWorkload| { let run = run_promql(&workload); @@ -255,7 +255,7 @@ fn stage3_plan_selection_a_monthly_amortizes_ingestion_time_maintenance() { /// The 1-min tumbling KLL candidate yields B1 (ingestion time), B2 (not materialized) and B3 (query time, kept). #[test] -#[ignore = "needs tumbling windows (#601), materialization enumeration (#604) and MatAtQuery panes (#625)"] +#[ignore = "needs B3: panes built at query time and kept across evaluations (G9, #625)"] fn stage2_physical_asap_optimization_b_tumbling_kll_has_three_materialization_options() { let found: BTreeSet<_> = options_of(&run_promql(&pattern_b()), tumbling(), 1) .into_keys() @@ -268,7 +268,6 @@ fn stage2_physical_asap_optimization_b_tumbling_kll_has_three_materialization_op /// B1 builds the tumbling KLLs at ingestion time and merges and estimates at query time. #[test] -#[ignore = "needs tumbling windows (#601) and materialization enumeration (#604)"] fn stage2_physical_asap_optimization_b_b1_builds_at_ingestion_and_merges_at_query_time() { let run = run_promql(&pattern_b()); let (id, build) = options_of(&run, tumbling(), 1)[&MatAtIngestion].clone(); @@ -291,9 +290,27 @@ fn stage2_physical_asap_optimization_b_b1_builds_at_ingestion_and_merges_at_quer } } +/// Implementer test (until B3, G9): the tumbling KLL candidate yields B1 +/// (maintained at ingestion time) and B2 (rebuilt at every evaluation); +/// both are priced, and B2's evaluation stays within the 200 ms bound. +#[test] +fn stage2_physical_asap_optimization_b_tumbling_kll_has_b1_and_b2() { + let run = run_promql(&pattern_b()); + let options = options_of(&run, tumbling(), 1); + assert_eq!( + options.keys().copied().collect::>(), + BTreeSet::from([MatAtIngestion, NotMaterialized]) + ); + for (id, _) in options.values() { + assert!(run.cost(id).is_some(), "{id} is priced"); + let latency = run.selection.costs[id].latency[0].total_ms(); + assert!(latency <= 200.0, "{id}: {latency} ms"); + } +} + /// B3 runs nothing at ingestion time; it keeps the tumbling KLLs it builds at query time. #[test] -#[ignore = "needs tumbling windows (#601) and MatAtQuery panes (#625)"] +#[ignore = "needs B3: panes built at query time and kept across evaluations (G9, #625)"] fn stage2_physical_asap_optimization_b_b3_keeps_query_time_windows() { let run = run_promql(&pattern_b()); let (id, _) = options_of(&run, tumbling(), 1)[&MatAtQuery].clone(); @@ -306,7 +323,7 @@ fn stage2_physical_asap_optimization_b_b3_keeps_query_time_windows() { /// The sliding-window KLL is kept from ingestion time or from query time; not materializing it is the no-window plan. #[test] -#[ignore = "needs sliding windows (no PR yet) and materialization enumeration (#604)"] +#[ignore = "needs sliding windows (no PR yet)"] fn stage2_physical_asap_optimization_b_sliding_kll_has_two_materialization_options() { let found: BTreeSet<_> = options_of(&run_promql(&pattern_b()), sliding(), 1) .into_keys() @@ -316,7 +333,7 @@ fn stage2_physical_asap_optimization_b_sliding_kll_has_two_materialization_optio /// B2 rebuilds all five tumbling KLLs at every evaluation, so it costs at least B1 and B3. #[test] -#[ignore = "needs tumbling windows (#601), materialization enumeration (#604) and MatAtQuery panes (#625)"] +#[ignore = "needs B3: panes built at query time and kept across evaluations (G9, #625)"] fn stage3_plan_selection_b_rebuilding_every_window_costs_most() { let run = run_promql(&pattern_b()); let options = options_of(&run, tumbling(), 1); @@ -328,7 +345,7 @@ fn stage3_plan_selection_b_rebuilding_every_window_costs_most() { /// Repeating over arriving data, the built-in models pick B1 among the tumbling options. #[test] -#[ignore = "needs tumbling windows (#601), materialization enumeration (#604) and MatAtQuery panes (#625)"] +#[ignore = "the built-in model contradicts it: B1 keeps 6 panes of 1M per-series KLLs (107 GB) for 13,326.5 cost/s, B2 rebuilds them for 2.183; needs B3 (G9) and the model-relative rewrite (Q49, G9)"] fn stage3_plan_selection_b_prefers_ingestion_time_tumbling_windows() { let run = run_promql(&pattern_b()); let options = options_of(&run, tumbling(), 1); diff --git a/crates/integration-tests/tests/stage2_physical_asap_optimization_sql.rs b/crates/integration-tests/tests/stage2_physical_asap_optimization_sql.rs index aca6d2155..06b4ff3a7 100644 --- a/crates/integration-tests/tests/stage2_physical_asap_optimization_sql.rs +++ b/crates/integration-tests/tests/stage2_physical_asap_optimization_sql.rs @@ -110,8 +110,14 @@ async fn check_every_choice( } }; let roots: Vec<_> = composed.into_iter().map(|(_, root)| root).collect(); - let candidate = optimize_physical_asap("L1", &roots) - .unwrap_or_else(|e| panic!("{sql}, choice {choice:?} pruned: {e}")); + let candidate = optimize_physical_asap( + "L1", + &roots, + &[], + &asap_types::workload::DataWorkload::default(), + ) + .unwrap_or_else(|e| panic!("{sql}, choice {choice:?} pruned: {e}")) + .remove(0); let QueryRoot::Operator(physical) = &candidate.roots[0] else { panic!("operator root") }; diff --git a/crates/integration-tests/tests/tumbling_pane_merge.rs b/crates/integration-tests/tests/tumbling_pane_merge.rs index 6f52d653e..088922bfa 100644 --- a/crates/integration-tests/tests/tumbling_pane_merge.rs +++ b/crates/integration-tests/tests/tumbling_pane_merge.rs @@ -291,7 +291,40 @@ fn execute_retained(root: &Rc, panes: &[Rc]) -> Vec< for pane in panes { assignment.set(pane, Materialization::MatAtIngestion(Medium::Memory)); } - let exported = export(root, &assignment); + execute_retained_as(root, &assignment) +} + +/// The planner's pane chain maintained at ingestion time, as Stage 2's B1 +/// option assigns it (`MatAtIngestion` on the chain), then expanded: each +/// pane carries the chain's timing and materialization, so the panes are +/// built in ingestion runs and merged in the query run. +fn execute_maintained_chain(planned: &Rc) -> Vec> { + let chain = OperatorNode::reachable(planned) + .into_iter() + .find(|n| matches!(n.asap(), Some(ASAPOp::PaneChain { .. }))) + .expect("a pane chain"); + let mut assignment = MaterializationAssignment::default(); + assignment.set(&chain, Materialization::MatAtIngestion(Medium::Memory)); + let timed = + apply_materialization_timings(planned, &assignment, &mut TimingMemo::new()).unwrap(); + let expanded = expand_pane_chains(&timed).unwrap(); + for pane in OperatorNode::reachable(&expanded) + .iter() + .filter(|n| matches!(n.asap(), Some(ASAPOp::SummaryAgg { .. }))) + { + assert_eq!( + pane.materialization, + Materialization::MatAtIngestion(Medium::Memory) + ); + } + execute_retained_as(&expanded, &MaterializationAssignment::default()) +} + +fn execute_retained_as( + root: &Rc, + assignment: &MaterializationAssignment, +) -> Vec> { + let exported = export(root, assignment); let inputs = raw_inputs(&exported); let contracts = contracts(&inputs); let mut retained = BTreeMap::new(); @@ -367,6 +400,11 @@ fn assert_pane_merge_matches_single_build(query: &str, accuracy: AccuracyTarget) expected, "the planner's pane chain, expanded" ); + assert_eq!( + render(&execute_maintained_chain(&planned)), + expected, + "the planner's pane chain, maintained at ingestion time" + ); let unexpanded = compile_at_query_time(&planned).err().unwrap_or_default(); assert!(unexpanded.contains("PaneChain"), "{unexpanded}"); result diff --git a/crates/planner/tests/e2e_plan.rs b/crates/planner/tests/e2e_plan.rs index 83e0479d8..4eff5bdb7 100644 --- a/crates/planner/tests/e2e_plan.rs +++ b/crates/planner/tests/e2e_plan.rs @@ -143,7 +143,7 @@ async fn facade_plans_match_run_stage1_to_stage3() { let recurrence: Vec<_> = workload .query_workload .entries() - .map(|entry| entry.recurrence) + .map(|entry| asap_types::workload::QueryDemand::from(&entry)) .collect(); let run = run_stage1_to_stage3(roots, &targets, &recurrence, &data, models).unwrap(); let selection = run diff --git a/crates/planner/tests/plan_stages.rs b/crates/planner/tests/plan_stages.rs index 9194ae86d..f391b2126 100644 --- a/crates/planner/tests/plan_stages.rs +++ b/crates/planner/tests/plan_stages.rs @@ -44,7 +44,7 @@ fn promql_stages(query: &str, epsilon: f64) -> Stage1ToStage3Run { &workload .query_workload .entries() - .map(|entry| entry.recurrence) + .map(|entry| asap_types::workload::QueryDemand::from(&entry)) .collect::>(), &workload.data_workload.unwrap(), PlanningModels::builtin(), diff --git a/crates/planner/tests/summary_sharing.rs b/crates/planner/tests/summary_sharing.rs index 0ac116360..83ee63a3c 100644 --- a/crates/planner/tests/summary_sharing.rs +++ b/crates/planner/tests/summary_sharing.rs @@ -109,7 +109,7 @@ fn promql_stages(queries: &[(&str, f64)]) -> Stage1ToStage3Run { &workload .query_workload .entries() - .map(|entry| entry.recurrence) + .map(|entry| asap_types::workload::QueryDemand::from(&entry)) .collect::>(), &workload.data_workload.clone().unwrap(), PlanningModels::builtin(), diff --git a/crates/types/src/ir/mod.rs b/crates/types/src/ir/mod.rs index 007880384..e6d91e988 100644 --- a/crates/types/src/ir/mod.rs +++ b/crates/types/src/ir/mod.rs @@ -24,8 +24,8 @@ pub mod physical_export; pub mod timing; pub use crate::post_asap::execution_data_state::{Materialization, Medium}; pub use timing::{ - apply_materialization_timings, data_state, planned_data_state, split_shared_by_phase, - validate_at_ingestion, MaterializationAssignment, TimingMemo, + apply_materialization_timings, data_state, is_filtered_build, planned_data_state, + split_shared_by_phase, validate_at_ingestion, MaterializationAssignment, TimingMemo, }; pub mod schema_support; /// Semantic observation coverage, separate from field layout and physical timing. diff --git a/crates/types/src/ir/pane_chain.rs b/crates/types/src/ir/pane_chain.rs index a112ca376..6b9c93dc0 100644 --- a/crates/types/src/ir/pane_chain.rs +++ b/crates/types/src/ir/pane_chain.rs @@ -16,6 +16,7 @@ use super::node::{Operator, OperatorNode}; use super::non_asap::{NonASAPOp, TimeRangeKind}; use super::operator_properties::TimeShift; use super::SchemaDerivationError; +use crate::post_asap::ExecutionTiming; fn invalid(message: &str) -> SchemaDerivationError { SchemaDerivationError::InvalidScalarSignature(message.into()) @@ -151,17 +152,34 @@ fn build_over( /// `root` with every `PaneChain` expanded into its panes: a `SummaryMerge` /// reads each pane of each chain it read, newest first, as plain /// `SummaryAgg` nodes the executor runs. Every other node keeps its -/// guarantee, timing and materialization. The panes are new nodes without -/// timing or materialization: a chain's own materialization is dropped, so -/// expansion runs before timings are applied, and materializing panes -/// (keeping all but the newest between evaluations) is left to Stage 2 -/// (G8). A chain read by anything but a `SummaryMerge` is an error. +/// guarantee, timing and materialization. Each pane takes its chain's +/// timing and materialization, and the range and shift it reads take the +/// chain's timing: a chain materialized at ingestion time expands into +/// panes each built and stored at ingestion time. Expanding before timings +/// are applied leaves the panes untimed. A chain read by anything but a +/// `SummaryMerge` is an error. pub fn expand_pane_chains( root: &Rc, ) -> Result, SchemaDerivationError> { expand(root, &mut HashMap::new()) } +/// The untimed `node` with `timing` written into it and into every untimed +/// node below it: the nodes [`pane`] created, over the chain's input, which +/// the timing pass already timed. +fn timed_like(node: &Rc, timing: ExecutionTiming) -> OperatorNode { + OperatorNode::with_schema( + node.operator.map_children(|child| match child.timing { + Some(_) => Rc::clone(child), + None => Rc::new(timed_like(child, timing)), + }), + node.schema.clone(), + ) + .with_guarantee(node.guarantee.clone()) + .with_materialization(node.materialization) + .with_timing(Some(timing)) +} + fn expand( node: &Rc, memo: &mut HashMap<*const OperatorNode, Rc>, @@ -179,7 +197,14 @@ fn expand( match child.asap() { Some(ASAPOp::PaneChain { pane_count, .. }) => { for index in 0..*pane_count { - inputs.push(Rc::new(pane(child, index)?)); + let pane = Rc::new(pane(child, index)?); + inputs.push(match child.timing { + Some(timing) => Rc::new( + timed_like(&pane, timing) + .with_materialization(child.materialization), + ), + None => pane, + }); } } _ => inputs.push(expand(child, memo)?), diff --git a/crates/types/src/ir/timing.rs b/crates/types/src/ir/timing.rs index c77de139c..075a821d4 100644 --- a/crates/types/src/ir/timing.rs +++ b/crates/types/src/ir/timing.rs @@ -113,13 +113,20 @@ impl MaterializationAssignment { ) -> Result { let at_ingestion = |m: Materialization| m.timing() == ExecutionTiming::IngestionTime; match self.get(node) { + Some(m) if at_ingestion(m) && is_filtered_build(node) => { + Err(ExecutionDataStateError::FilteredSummaryAtIngestion { + operator: node.operator.kind_name(), + }) + } Some(m) if at_ingestion(m) && upstream_at_query_time => { Err(ExecutionDataStateError::UpstreamNotAtIngestion { operator: node.operator.kind_name(), }) } Some(m) => Ok(m), - None if at_ingestion(self.unassigned) && upstream_at_query_time => { + None if at_ingestion(self.unassigned) + && (upstream_at_query_time || is_filtered_build(node)) => + { Ok(Materialization::NotMaterialized) } None => Ok(self.unassigned), @@ -140,6 +147,24 @@ pub(crate) fn is_materialization_point(operator: &Operator) -> bool { ) } +/// Whether `node` is a summary build (`SummaryAgg` or `PaneChain`) with a +/// filter, which never runs at ingestion time +/// ([`ExecutionDataStateError::FilteredSummaryAtIngestion`]). +pub fn is_filtered_build(node: &OperatorNode) -> bool { + matches!( + node.asap(), + Some( + ASAPOp::SummaryAgg { + filter: Some(_), + .. + } | ASAPOp::PaneChain { + filter: Some(_), + .. + } + ) + ) +} + /// Memo of one [`apply_materialization_timings`] pass: `input node → timed node`, /// shared by every root of a workload so a node shared by two roots stays /// one `Rc`. Re-reaching a node with a different timing is a conflict. @@ -314,6 +339,11 @@ fn placement( .any(|child| forces_query_time(child, assignment, forced)) }; if let Some(placed) = node.timing { + if placed == ExecutionTiming::IngestionTime && is_filtered_build(node) { + return Err(ExecutionDataStateError::FilteredSummaryAtIngestion { + operator: node.operator.kind_name(), + }); + } if placed == ExecutionTiming::IngestionTime && upstream_at_query_time(forced) { return Err(ExecutionDataStateError::UpstreamNotAtIngestion { operator: node.operator.kind_name(), @@ -719,16 +749,18 @@ fn validate_non_asap( } /// Copy, for one consumer, every sub-DAG that `assignment` would reach with -/// two different timings, so that a workload whose CSE shared a `Scan` -/// between an ingestion-time summary and a query-time computation can still -/// be timed. Only the conflicting sub-DAGs are copied; a sub-DAG reached with -/// one timing stays one `Rc`. Returns the (possibly rewritten) root and -/// `assignment` remapped onto it: a rebuilt node keeps its original's -/// explicit materialization. +/// two different timings from `roots` (one query each, or the roots of one +/// query), so that a workload whose CSE shared a `Scan` between an +/// ingestion-time summary and a query-time computation, in one query or +/// across queries, can still be timed. Only the conflicting sub-DAGs are +/// copied, one copy per timing; a sub-DAG reached with one timing stays one +/// `Rc`, shared by the roots that read it. Returns the (possibly rewritten) +/// roots, in order, and `assignment` remapped onto them: a rebuilt node +/// keeps its original's explicit materialization. pub fn split_shared_by_phase( - root: &Rc, + roots: &[Rc], assignment: &MaterializationAssignment, -) -> (Rc, MaterializationAssignment) { +) -> (Vec>, MaterializationAssignment) { // First pass: the set of timings each node is reached with. let mut reached: HashMap<*const OperatorNode, Vec> = HashMap::new(); let mut forced = HashMap::new(); @@ -749,15 +781,17 @@ pub fn split_shared_by_phase( collect(child, timing, assignment, reached, forced); } } - collect( - root, - ExecutionTiming::QueryTime, - assignment, - &mut reached, - &mut forced, - ); + for root in roots { + collect( + root, + ExecutionTiming::QueryTime, + assignment, + &mut reached, + &mut forced, + ); + } if reached.values().all(|timings| timings.len() <= 1) { - return (Rc::clone(root), assignment.clone()); + return (roots.to_vec(), assignment.clone()); } // Second pass: rebuild, giving each (node, timing) pair its own copy. let mut copies: HashMap<(*const OperatorNode, ExecutionTiming), Rc> = @@ -797,21 +831,26 @@ pub fn split_shared_by_phase( copies.insert(key, Rc::clone(&out)); out } - let root = rebuild( - root, - ExecutionTiming::QueryTime, - assignment, - &reached, - &mut copies, - &mut forced, - ); + let split = roots + .iter() + .map(|root| { + rebuild( + root, + ExecutionTiming::QueryTime, + assignment, + &reached, + &mut copies, + &mut forced, + ) + }) + .collect(); let mut remapped = assignment.clone(); for ((original, _), copy) in &copies { if let Some((_, materialization)) = assignment.assigned.get(original) { remapped.set(copy, *materialization); } } - (root, remapped) + (split, remapped) } /// Maintenance arithmetic needs the same per-series population on both sides. @@ -1141,8 +1180,11 @@ mod tests { second: ExecutionDataState::QUERY_ROWS, }) ); - let (split, assignment) = split_shared_by_phase(&root, &all_at_ingestion()); - assert!(apply_materialization_timings(&split, &assignment, &mut TimingMemo::new()).is_ok()); + let (split, assignment) = + split_shared_by_phase(std::slice::from_ref(&root), &all_at_ingestion()); + assert!( + apply_materialization_timings(&split[0], &assignment, &mut TimingMemo::new()).is_ok() + ); } /// A finalize pinned to ingestion time (as fixed-window rate candidates @@ -1184,9 +1226,9 @@ mod tests { .unwrap(); let mut assignment = MaterializationAssignment::default(); assignment.set(&summary, AT_INGESTION); - let (split, assignment) = split_shared_by_phase(&root, &assignment); + let (split, assignment) = split_shared_by_phase(std::slice::from_ref(&root), &assignment); let timed = - apply_materialization_timings(&split, &assignment, &mut TimingMemo::new()).unwrap(); + apply_materialization_timings(&split[0], &assignment, &mut TimingMemo::new()).unwrap(); let summary = child(&child(&child(&timed))); assert!(matches!( summary.operator, @@ -1227,6 +1269,116 @@ mod tests { ); } + /// A summary build with a filter never runs at ingestion time: an + /// ingestion-time build reads raw samples, which carry none of the + /// query's columns the filter reads. An explicit `MatAtIngestion` is an + /// error; the all-at-ingestion default leaves it at query time. + #[test] + fn a_filtered_summary_build_never_runs_at_ingestion_time() { + use crate::ir::{Predicate, ScalarExpr}; + use crate::pre_asap::expr_ir::ScalarValue; + let plain = agg(scan(), kll()); + let Operator::ASAP(ASAPOp::SummaryAgg { + child: rows, + family, + input, + reduction, + grouping, + .. + }) = plain.operator.clone() + else { + unreachable!() + }; + let filtered = Rc::new( + OperatorNode::with_schema( + Operator::ASAP(ASAPOp::SummaryAgg { + child: rows, + family, + input, + reduction, + grouping, + filter: Some(Predicate(ScalarExpr::Literal(ScalarValue::Boolean(true)))), + }), + plain.schema.clone(), + ) + .with_guarantee(None), + ); + let mut assignment = MaterializationAssignment::default(); + assignment.set(&filtered, AT_INGESTION); + assert_eq!( + apply_materialization_timings( + &estimate(Rc::clone(&filtered)), + &assignment, + &mut TimingMemo::new() + ) + .err(), + Some(ExecutionDataStateError::FilteredSummaryAtIngestion { + operator: "SummaryAgg" + }) + ); + let timed = apply(&estimate(filtered)).unwrap(); + assert_eq!(child(&timed).timing, Some(ExecutionTiming::QueryTime)); + assert_eq!( + child(&timed).materialization, + Materialization::NotMaterialized + ); + assert!(validate_at_ingestion(&child(&timed), ExecutionTiming::QueryTime).is_ok()); + } + + /// Two queries share a scan: one reads it through a summary built at + /// ingestion time, the other at query time. Splitting the workload's + /// roots together copies the scan for one phase, so one timing pass + /// over both roots succeeds; a node both queries reach at one timing + /// stays one node. + #[test] + fn split_across_roots_copies_only_what_two_queries_read_at_two_phases() { + let shared = scan(); + let summary = agg(Rc::clone(&shared), kll()); + let by_summary = max(estimate(Rc::clone(&summary))); + let raw = max(Rc::clone(&shared)); + let common = max(estimate(agg(scan(), kll()))); + let roots = [ + concat(vec![Rc::clone(&by_summary), Rc::clone(&common)]), + concat(vec![raw, Rc::clone(&common)]), + ]; + let mut assignment = MaterializationAssignment::default(); + assignment.set(&summary, AT_INGESTION); + let timed_unsplit = { + let mut memo = TimingMemo::new(); + roots + .iter() + .map(|root| apply_materialization_timings(root, &assignment, &mut memo)) + .collect::, _>>() + }; + assert!(matches!( + timed_unsplit, + Err(ExecutionDataStateError::ConflictingTiming { .. }) + )); + let (split, assignment) = split_shared_by_phase(&roots, &assignment); + assert_eq!(split.len(), 2); + let mut memo = TimingMemo::new(); + let timed: Vec<_> = split + .iter() + .map(|root| apply_materialization_timings(root, &assignment, &mut memo).unwrap()) + .collect(); + let summary = child(&child(&child(&timed[0]))); + assert_eq!(summary.materialization, AT_INGESTION); + assert_eq!(child(&summary).timing, Some(ExecutionTiming::IngestionTime)); + assert_eq!( + child(&child(&timed[1])).timing, + Some(ExecutionTiming::QueryTime) + ); + assert!(Rc::ptr_eq(timed[0].children()[1], timed[1].children()[1])); + } + + fn concat(children: Vec>) -> Rc { + OperatorNode::new_shared(crate::ir::Operator::NonASAP(NonASAPOp::Concat { + children, + discriminator_unique_key: None, + })) + .unwrap() + } + fn finalize(child: Rc) -> Rc { OperatorNode::new_shared(crate::ir::Operator::ASAP( ASAPOp::FinalizeExactAccumulator { child }, diff --git a/crates/types/src/post_asap/execution_data_state.rs b/crates/types/src/post_asap/execution_data_state.rs index 3a5e13b7c..dc4240d51 100644 --- a/crates/types/src/post_asap/execution_data_state.rs +++ b/crates/types/src/post_asap/execution_data_state.rs @@ -176,6 +176,12 @@ pub enum ExecutionDataStateError { fixed: ExecutionTiming, materialization: Materialization, }, + /// A summary build with a filter placed at ingestion time. An + /// ingestion-time build reads raw samples, which carry none of the + /// query's columns the filter reads, so only a query-time build can + /// apply it. + #[error("{operator} has a filter, which only a query-time build can apply")] + FilteredSummaryAtIngestion { operator: &'static str }, #[error("unsupported maintenance binary schema or operator")] InvalidMaintenanceBinary, #[error("checked division requires one valid guard on a read-time division operator")] diff --git a/crates/types/src/workload.rs b/crates/types/src/workload.rs index 8d6ee920c..acceeacab 100644 --- a/crates/types/src/workload.rs +++ b/crates/types/src/workload.rs @@ -402,6 +402,51 @@ pub struct QueryWorkloadEntry { pub time_selection: TimeSelection, } +/// How one query is demanded, as planning reads it: its recurrence, how far +/// ahead it is known, and its response-latency bound. Physical ASAP-aware +/// optimization reads the recurrence and predictability (whether state may +/// be kept from ingestion time); plan selection reads the recurrence (how +/// often each node runs) and the latency bound. +/// +/// # Example +/// +/// ``` +/// use asap_types::workload::{LatencyRequirement, Predictability, QueryDemand, QueryRecurrence}; +/// +/// // Anything not declared: unknown predictability, no latency bound. +/// let demand = QueryDemand::from(QueryRecurrence::Unknown); +/// assert_eq!(demand.predictability, Predictability::Unknown); +/// assert_eq!(demand.response_latency, LatencyRequirement::Unspecified); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub struct QueryDemand { + pub recurrence: QueryRecurrence, + pub predictability: Predictability, + pub response_latency: LatencyRequirement, +} + +impl From<&QueryWorkloadEntry> for QueryDemand { + fn from(entry: &QueryWorkloadEntry) -> Self { + Self { + recurrence: entry.recurrence.clone(), + predictability: entry.predictability.clone(), + response_latency: entry.requirements.response_latency, + } + } +} + +/// A query known only by its recurrence: unknown predictability and no +/// latency bound. +impl From for QueryDemand { + fn from(recurrence: QueryRecurrence) -> Self { + Self { + recurrence, + predictability: Predictability::Unknown, + response_latency: LatencyRequirement::Unspecified, + } + } +} + impl From<&BatchEntry> for QueryWorkloadEntry { fn from(entry: &BatchEntry) -> Self { Self { diff --git a/crates/types/tests/pane_chain.rs b/crates/types/tests/pane_chain.rs index 211a14e9a..a5894e584 100644 --- a/crates/types/tests/pane_chain.rs +++ b/crates/types/tests/pane_chain.rs @@ -161,6 +161,48 @@ fn expansion_merges_the_panes() { assert!(expand_pane_chains(&chain).is_err()); } +/// Expanding a timed chain carries its timing and materialization onto its +/// panes: a chain materialized at ingestion time expands into panes each +/// built and stored at ingestion time, over ranges and shifts that run at +/// ingestion time too, while the merge reading them stays at query time. +/// An unmaterialized chain expands into query-time panes. +#[test] +fn expansion_carries_the_chains_timing_onto_its_panes() { + use asap_types::ir::{ + apply_materialization_timings, Materialization, MaterializationAssignment, Medium, + TimingMemo, + }; + use asap_types::post_asap::ExecutionTiming; + let at_ingestion = Materialization::MatAtIngestion(Medium::Memory); + for (materialization, timing) in [ + (at_ingestion, ExecutionTiming::IngestionTime), + (Materialization::NotMaterialized, ExecutionTiming::QueryTime), + ] { + let chain = chain(shifted(scan(), MINUTE as i64)); + let estimate = OperatorNode::new_shared(Operator::ASAP(ASAPOp::SummaryEstimate { + summary_input: merge(vec![Rc::clone(&chain)]), + query: SketchStatistic::Quantile { q: 0.99 }, + })) + .unwrap(); + let mut assignment = MaterializationAssignment::default(); + assignment.set(&chain, materialization); + let timed = + apply_materialization_timings(&estimate, &assignment, &mut TimingMemo::new()).unwrap(); + let expanded = expand_pane_chains(&timed).unwrap(); + let merged = expanded.children()[0]; + assert_eq!(merged.timing, Some(ExecutionTiming::QueryTime)); + assert_eq!(merged.children().len(), 5); + for pane in merged.children() { + assert_eq!(pane.timing, Some(timing), "{materialization:?}"); + assert_eq!(pane.materialization, materialization); + for below in OperatorNode::reachable(pane).iter().skip(1) { + assert_eq!(below.timing, Some(timing), "{}", below.operator.kind_name()); + assert_eq!(below.materialization, Materialization::NotMaterialized); + } + } + } +} + /// A chain needs a positive width and count, and reads the instant vector /// a range selector would. #[test] diff --git a/docs/design_docs/proposals/planner-layering-example4-acceptance.md b/docs/design_docs/proposals/planner-layering-example4-acceptance.md index 8468e68f3..d86107c56 100644 --- a/docs/design_docs/proposals/planner-layering-example4-acceptance.md +++ b/docs/design_docs/proposals/planner-layering-example4-acceptance.md @@ -49,9 +49,12 @@ every other logical candidate gets its own the same way (not counted). time, both kept. Not materializing it is the no-window plan, so it is not a separate option. -**Today:** no window summaries, and physical ASAP-aware optimization assigns -every sub-DAG `NotMaterialized` (#667's options exist in the IR; their -enumeration is #604), so none of these candidates exists. +**Today:** Pass 2 builds tumbling panes (`PaneChain`), and physical +ASAP-aware optimization enumerates `NotMaterialized`, `MatAtIngestion` and +`MatAtQuery` (state reused within one evaluation) for every summary build. +B1 and B2 exist. B3 (panes built at query time and kept across +evaluations) comes with G9 (#625), and Pattern A's shared EH with #628 and +#634, so A1–A3 do not exist yet. ## Invariants and tests @@ -59,38 +62,43 @@ enumeration is #604), so none of these candidates exists. `Materialization` (#667). Tests read it through `planner_layering_common::materialization(p, node)` without the storage medium (`MatAtIngestion`, `MatAtQuery`, `NotMaterialized`), and the kept -event-time span through `retention_ms(p, node)`, which returns `None` until -the IR records retention. +event-time span through `retention_ms(p, node)`. The IR does not record +retention, so the adapter derives it the way plan selection prices kept +state: a chain of `N` panes of width `w` keeps `N·w`, plus one pane while +maintained at ingestion time; a whole-window build keeps its window, plus +the next one at ingestion time; each plus the offset of the shifts below +it. ### Constraints over every candidate | Invariant | Test | Status | |---|---|---| -| Every node upstream of an ingestion-time node also runs at ingestion time (all variants) | `stage2_physical_asap_optimization_ingestion_time_upstream_is_ingestion_time` | passes (vacuously today) | -| With data at rest, no node runs at ingestion time | `stage2_physical_asap_optimization_at_rest_runs_nothing_at_ingestion_time` | passes (vacuously today) | -| A materialized output covers its consumers: retention ≥ max over its readers of `lookback` + offset | `stage2_physical_asap_optimization_materialized_output_covers_its_consumers` | passes (vacuously today) | +| Every node upstream of an ingestion-time node also runs at ingestion time (all variants) | `stage2_physical_asap_optimization_ingestion_time_upstream_is_ingestion_time` | passes: B1 and the monthly variant's maintained panes | +| With data at rest, no node runs at ingestion time | `stage2_physical_asap_optimization_at_rest_runs_nothing_at_ingestion_time` | passes | +| A materialized output covers its consumers: retention ≥ max over its readers of `lookback` + offset | `stage2_physical_asap_optimization_materialized_output_covers_its_consumers` | passes: B1 keeps 6 min ≥ 5 min | ### Pattern A | Invariant | Test | Status | |---|---|---| -| The shared EH yields exactly A1, A2, A3 | `stage2_physical_asap_optimization_a_shared_eh_has_three_materialization_options` | ignored: #628, #634, #604, #625 | -| At rest, A2 is not generated; A1 and A3 remain | `stage2_physical_asap_optimization_a_at_rest_drops_the_ingestion_time_option` | ignored: #628, #634, #604, #625 | -| A materialized EH is one build node read by all five queries, priced once | `stage2_physical_asap_optimization_a_materialized_eh_is_built_once_for_all_consumers` | ignored: #628, #634, #604, #625 | -| A3 costs strictly more than A1 (five builds instead of one: a `NotMaterialized` node is charged per consuming query) | `stage3_plan_selection_a_rebuilding_per_query_costs_more_than_building_once` | ignored: #628, #634, #604, #625 | -| As given, A1 is the cheapest of the three | `stage3_plan_selection_a_once_adhoc_prefers_the_query_time_eh` | ignored: #628, #634, #604, #625 | -| Monthly, A2's cost relative to A1 drops: cost(A2)/cost(A1) monthly < as given | `stage3_plan_selection_a_monthly_amortizes_ingestion_time_maintenance` | ignored: #628, #634, #604, #625 | +| The shared EH yields exactly A1, A2, A3 | `stage2_physical_asap_optimization_a_shared_eh_has_three_materialization_options` | ignored: the shared EH (#628, #634) | +| At rest, A2 is not generated; A1 and A3 remain | `stage2_physical_asap_optimization_a_at_rest_drops_the_ingestion_time_option` | ignored: the shared EH (#628, #634) | +| A materialized EH is one build node read by all five queries, priced once | `stage2_physical_asap_optimization_a_materialized_eh_is_built_once_for_all_consumers` | ignored: the shared EH (#628, #634) | +| A3 costs strictly more than A1 (five builds instead of one: a `NotMaterialized` node is charged per consuming query) | `stage3_plan_selection_a_rebuilding_per_query_costs_more_than_building_once` | ignored: the shared EH (#628, #634) | +| As given, A1 is the cheapest of the three | `stage3_plan_selection_a_once_adhoc_prefers_the_query_time_eh` | ignored: the shared EH (#628, #634) | +| Monthly, A2's cost relative to A1 drops: cost(A2)/cost(A1) monthly < as given | `stage3_plan_selection_a_monthly_amortizes_ingestion_time_maintenance` | ignored: the shared EH (#628, #634) | ### Pattern B | Invariant | Test | Status | |---|---|---| -| The tumbling KLL candidate yields exactly B1, B2, B3 | `stage2_physical_asap_optimization_b_tumbling_kll_has_three_materialization_options` | ignored: #601, #604, #625 | -| B1 builds at ingestion time; its merge and estimate run at query time | `stage2_physical_asap_optimization_b_b1_builds_at_ingestion_and_merges_at_query_time` | ignored: #601, #604 | -| B3 runs nothing at ingestion time | `stage2_physical_asap_optimization_b_b3_keeps_query_time_windows` | ignored: #601, #625 | -| The sliding KLL yields exactly ingestion time and query time, kept | `stage2_physical_asap_optimization_b_sliding_kll_has_two_materialization_options` | ignored: sliding windows (no PR yet), #604 | -| B2 costs at least B1 and B3 | `stage3_plan_selection_b_rebuilding_every_window_costs_most` | ignored: #601, #604, #625 | -| With the built-in models, B1 is the cheapest of the three | `stage3_plan_selection_b_prefers_ingestion_time_tumbling_windows` | ignored: #601, #604, #625 | +| The tumbling KLL candidate yields exactly B1, B2, B3 | `stage2_physical_asap_optimization_b_tumbling_kll_has_three_materialization_options` | ignored: B3 (G9, #625) | +| Until B3: the tumbling KLL candidate yields B1 and B2, both priced within the 200 ms latency bound (implementer test) | `stage2_physical_asap_optimization_b_tumbling_kll_has_b1_and_b2` | passes | +| B1 builds at ingestion time; its merge and estimate run at query time | `stage2_physical_asap_optimization_b_b1_builds_at_ingestion_and_merges_at_query_time` | passes | +| B3 runs nothing at ingestion time | `stage2_physical_asap_optimization_b_b3_keeps_query_time_windows` | ignored: B3 (G9, #625) | +| The sliding KLL yields exactly ingestion time and query time, kept | `stage2_physical_asap_optimization_b_sliding_kll_has_two_materialization_options` | ignored: sliding windows (no PR yet) | +| B2 costs at least B1 and B3 | `stage3_plan_selection_b_rebuilding_every_window_costs_most` | ignored: B3 (G9, #625) | +| With the built-in models, B1 is the cheapest of the three | `stage3_plan_selection_b_prefers_ingestion_time_tumbling_windows` | ignored: the built-in model contradicts it. B1 keeps 6 panes of 1M per-series KLLs (about 107 GB) for 13,326.5 cost/s; B2 rebuilds them for 2.183, and the whole-window KLL (P2, 2.100) is selected | ### Selection direction, relative to the cost model @@ -114,11 +122,10 @@ the IR records retention. optimization does not duplicate the node. So A3 costs five EH builds and A1 one, as the tests require. The A3 tests stay ignored only because the shared EH and its materialization options do not exist yet. -2. **Recurrence input.** Materialization depends on `recurrence`, - `predictability` and `arrival`, but `optimize_physical_asap` takes only - the logical candidate and `select_plan` only the accuracy targets and - data workload. They need the per-entry recurrence for A2's amortization - and for B1 (#604). +2. **Recurrence input (resolved).** Materialization depends on + `recurrence`, `predictability` and `arrival`: `optimize_physical_asap` + takes each entry's `QueryDemand` (recurrence, predictability, latency + bound) and the data workload, and `select_plan` the same demands. 3. **Monthly variant.** The doc does not say whether each monthly run still ends at T or at its own run time, nor give `known_at`. Tests use a repeating entry whose window ends at each run, known at T. diff --git a/docs/user_guide_docs/stage-viewer.md b/docs/user_guide_docs/stage-viewer.md index 295aa0ef2..48d7d30df 100644 --- a/docs/user_guide_docs/stage-viewer.md +++ b/docs/user_guide_docs/stage-viewer.md @@ -68,10 +68,10 @@ plan wins. | Tab | Workload | What to look for | | --- | --- | --- | -| 1 · dashboard panels | Two PromQL panels over 1M counter series every 10 s: an exact per-job rate, and the approximate top-10 series per job | The exact query stays exact; the CMS+heap and CountSketch+heap top-k plans are rejected with their reasons, so the all-exact plan wins; the plans that share the two queries' scan and range selector tie with it, and the independent plan is kept on enumeration order. Pass 2 also builds Q1's rate and Q2's option in six 10-s tumbling panes, each alone or both (27 plans in all); rebuilt at every refresh, the panes cost more than the whole window | +| 1 · dashboard panels | Two PromQL panels over 1M counter series every 10 s: an exact per-job rate, and the approximate top-10 series per job | The exact query stays exact; the CMS+heap and CountSketch+heap top-k plans are rejected with their reasons, so the all-exact plan wins; the plans that share the two queries' scan and range selector tie with it, and the independent plan is kept on enumeration order. Pass 2 also builds Q1's rate and Q2's option in six 10-s tumbling panes, each alone or both (27 logical plans); rebuilt at every refresh, the panes cost more than the whole window. Stage 2 adds 30 plans that maintain Q1's rate panes, Q2's panes or both at ingestion time (57 physical plans); continuously ingesting PromQL data is taken to arrive in time order, so the rate panes may be maintained. Keeping seven panes of 1M per-series states costs more than rebuilding them (12.94 against 8.54 per second for either query's exact panes), so P1, all exact, is still selected at 7.94 | | 2 · SQL flow statistics | Distinct sources, entropy and L2 of per-source counts over the last minute of flows | All 82 plans compose and are priced; none is pruned. The SQL frontend recognizes Q2 as entropy and Q3 (its counts cast to DOUBLE) as L2, each with an exact or UnivMon option and an exact population count for the empty-input NULL. 16 plans come from Pass 1. Pass 2 adds the plans that share identical nodes and, by the summary-capability rule, the plans in which one UnivMon serves two of the queries or all three, sized with each parameter's largest value among them. 70 plans are invalid: HLL or UnivMon for Q1 (50) because its bound has "failure probability None" (both need the source's distinct bound, which this example does not declare), and UnivMon for Q2 (20) because entropy has no certified bound. 12 are valid: Q1 exact or KMV, Q2 exact, and Q3 exact or UnivMon, each alone or sharing identical nodes. Q3's UnivMon keeps its L2 guarantee through the exact population count joined beside it and the `CASE` that decides the empty-input NULL on that count. Theta is not offered: `asap_sketchlib` has no Theta sketch. P1 (all exact) is selected at 6.08 per second; KMV on Q1 costs the same to three decimals, UnivMon on Q3 costs 8.08, and the shared plans cost 7.44 or more, because a shared node that is not materialized is charged once per query that reads it | | 3a · historical p99 batch | Five p99 reports over 1–5 years, run once | All 972 plans are priced: 243 Pass 1 plans, each with 3 shared-input plans. Each query builds its own sketch at query time. P485 is selected: KLL for all five queries. DDSketch in place of KLL ties, and the tie goes to enumeration order. The all-exact plan costs about 16% more | -| 3b · live p99 panel | p99 over the last 5 min every minute, 1M series | P2, KLL, is selected at 2.100 per second; exact over the window's raw samples costs 2.400. Pass 2 adds KLL and DDSketch in five 1-min tumbling panes (5 plans in all): rebuilt at every evaluation, the KLL panes cost 2.183, the whole build plus merging the panes. DDSketch misses the rank target. Memory a query holds only while it runs is not charged. Everything runs at query time and nothing is materialized. KLL panes kept from ingestion time and the 200 ms latency check come with the materialization PRs | +| 3b · live p99 panel | p99 over the last 5 min every minute, 1M series | P2, KLL, is selected at 2.100 per second; exact over the window's raw samples costs 2.400. Pass 2 adds KLL and DDSketch in five 1-min tumbling panes (5 plans in all): rebuilt at every evaluation, the KLL panes cost 2.183, the whole build plus merging the panes. DDSketch misses the rank target. Memory a query holds only while it runs is not charged. Stage 2 adds the KLL and DDSketch panes maintained at ingestion time (7 plans in all): maintained, the KLL panes keep six panes of 1M per-series KLLs, about 107 GB, for 13,326.5 per second, so P2 still wins. Every priced plan meets the 200 ms latency bound: the whole-window KLL takes 126 ms per evaluation, the panes rebuilt at query time 131 ms and the maintained panes 7 ms | | 4a · monthly p99 reports | Example 3a repeated monthly | The same plan, with its cost amortized over a month | | 4b · panes that pay off | p99 over the last hour every 10 min, 1k series sampled every second, raw data not kept by the deployment | Maintaining six 10-min KLL panes at ingestion time wins | diff --git a/tools/dag-viewer/examples/planner-layering-example1.json b/tools/dag-viewer/examples/planner-layering-example1.json index 446a95142..c92b7b17d 100644 --- a/tools/dag-viewer/examples/planner-layering-example1.json +++ b/tools/dag-viewer/examples/planner-layering-example1.json @@ -28798,7 +28798,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -28847,13 +28847,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -29062,7 +29062,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -29112,12 +29112,12 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -29167,12 +29167,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -29225,12 +29225,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -29280,12 +29280,12 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" }, { - "consumer": 10, + "consumer": 11, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -29335,12 +29335,12 @@ ] ] }, - "producer": 9, + "producer": 10, "role": "Input", "window": "NotApplicable" }, { - "consumer": 11, + "consumer": 12, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -29390,7 +29390,7 @@ ] ] }, - "producer": 10, + "producer": 11, "role": "Input", "window": "NotApplicable" } @@ -29463,7 +29463,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -29525,7 +29525,9 @@ { "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -29575,7 +29577,7 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { @@ -29944,10 +29946,136 @@ "primitive": "Raw", "timing": "query_time" }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, "payload": { "NonASAP": { "TimeRange": { - "child": 0, + "child": 6, "kind": "range", "range": { "nanos": 0, @@ -29959,7 +30087,7 @@ }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -30015,7 +30143,7 @@ "payload": { "ASAP": { "SummaryAgg": { - "child": 6, + "child": 7, "family": { "ExactAggregate": [ "Sum", @@ -30057,7 +30185,7 @@ "scope": "per_value" } }, - "id": 8, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -30110,7 +30238,7 @@ "payload": { "ASAP": { "FinalizeExactAccumulator": { - "child": 7 + "child": 8 } } } @@ -30134,7 +30262,7 @@ "scope": "per_value" } }, - "id": 9, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -30187,7 +30315,7 @@ "payload": { "NonASAP": { "Sort": { - "child": 8, + "child": 9, "keys": [ { "ascending": false, @@ -30223,7 +30351,7 @@ "scope": "per_value" } }, - "id": 10, + "id": 11, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -30276,7 +30404,7 @@ "payload": { "NonASAP": { "Limit": { - "child": 9, + "child": 10, "n": 10, "offset": 0, "partition_by": [ @@ -30305,7 +30433,7 @@ "scope": "per_value" } }, - "id": 11, + "id": 12, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -30337,7 +30465,7 @@ "payload": { "NonASAP": { "Project": { - "child": 10, + "child": 11, "cols": [ { "alias": "job", @@ -30360,13 +30488,13 @@ ], "roots": [ 5, - 11 + 12 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", - "from_logical": "L5", - "id": "P5" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L4", + "id": "P4-m1" }, { "dag": { @@ -30429,7 +30557,7 @@ { "consumer": 2, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -30446,9 +30574,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -30635,6 +30766,61 @@ "role": "Input", "window": "NotApplicable" }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, { "consumer": 7, "data_state": { @@ -30751,7 +30937,7 @@ { "consumer": 9, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -30768,12 +30954,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -30915,61 +31098,6 @@ "producer": 10, "role": "Input", "window": "NotApplicable" - }, - { - "consumer": 12, - "data_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "producer": 11, - "role": "Input", - "window": "NotApplicable" } ], "nodes": [ @@ -31100,24 +31228,7 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, "materialization": "NotMaterialized", "output_schema": { @@ -31133,9 +31244,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -31165,18 +31279,33 @@ ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "TimeRange": { + "ASAP": { + "PaneChain": { "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -31238,26 +31367,10 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "reduction": "PerEntity" + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -31538,56 +31651,12 @@ }, "payload": { "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" - } + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 } } } @@ -31650,7 +31719,7 @@ }, "payload": { "ASAP": { - "PaneChain": { + "SummaryAgg": { "child": 6, "family": { "ExactAggregate": [ @@ -31669,15 +31738,30 @@ "kind": "unknown_or_signed" } }, - "pane_count": 6, - "pane_width_ms": 10000, "reduction": "PerEntity" } } } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 8, "materialization": "NotMaterialized", "output_schema": { @@ -31693,12 +31777,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -31728,15 +31809,13 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 7 - ] + "FinalizeExactAccumulator": { + "child": 7 } } } @@ -31811,9 +31890,21 @@ "timing": "query_time" }, "payload": { - "ASAP": { - "FinalizeExactAccumulator": { - "child": 8 + "NonASAP": { + "Sort": { + "child": 8, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] } } } @@ -31823,7 +31914,7 @@ "provenance": [ { "kind": "exact", - "reason": "exact accumulator over exact input" + "reason": "exact over exact inputs" } ], "spec": { @@ -31889,17 +31980,10 @@ }, "payload": { "NonASAP": { - "Sort": { + "Limit": { "child": 9, - "keys": [ - { - "ascending": false, - "expr": { - "Column": 1 - }, - "nulls_first": false - } - ], + "n": 10, + "offset": 0, "partition_by": [ 2 ] @@ -31928,88 +32012,6 @@ }, "id": 11, "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Limit": { - "child": 10, - "n": 10, - "offset": 0, - "partition_by": [ - 2 - ] - } - } - } - }, - { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, - "id": 12, - "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -32040,7 +32042,7 @@ "payload": { "NonASAP": { "Project": { - "child": 11, + "child": 10, "cols": [ { "alias": "job", @@ -32063,13 +32065,13 @@ ], "roots": [ 5, - 12 + 11 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes", - "from_logical": "L6", - "id": "P6" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", + "from_logical": "L5", + "id": "P5" }, { "dag": { @@ -32078,7 +32080,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -32127,13 +32129,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -32149,9 +32151,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -32339,7 +32344,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -32389,14 +32394,14 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -32413,12 +32418,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -32447,12 +32449,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -32505,12 +32507,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -32560,12 +32562,12 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" }, { - "consumer": 10, + "consumer": 11, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -32615,12 +32617,12 @@ ] ] }, - "producer": 9, + "producer": 10, "role": "Input", "window": "NotApplicable" }, { - "consumer": 11, + "consumer": 12, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -32670,7 +32672,7 @@ ] ] }, - "producer": 10, + "producer": 11, "role": "Input", "window": "NotApplicable" } @@ -32743,7 +32745,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -32803,91 +32805,11 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] + "materialization": { + "MatAtIngestion": "Memory" }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } - } - } - } - }, - { - "guarantee": null, - "id": 2, - "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -32937,12 +32859,12 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, + "PaneChain": { + "child": 0, "family": { "ExactAggregate": [ "Rate", @@ -32960,31 +32882,16 @@ "kind": "unknown_or_signed" } }, + "pane_count": 6, + "pane_width_ms": 10000, "reduction": "PerEntity" } } } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact accumulator over exact input" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, - "id": 3, + "guarantee": null, + "id": 2, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -32999,9 +32906,91 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", "nullable": false, "table": null }, @@ -33171,7 +33160,24 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", "output_schema": { @@ -33187,12 +33193,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -33222,40 +33225,151 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { - "child": 0, - "family": { - "ExactAggregate": [ - "Sum", - "Sum" + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] ] }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" + "source": { + "TimeSeries": { + "metric": "http_requests_total" } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": "PerEntity" + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } } } } }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -33310,10 +33424,26 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 6 - ] + "SummaryAgg": { + "child": 7, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" } } } @@ -33337,7 +33467,7 @@ "scope": "per_value" } }, - "id": 8, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -33390,7 +33520,7 @@ "payload": { "ASAP": { "FinalizeExactAccumulator": { - "child": 7 + "child": 8 } } } @@ -33414,7 +33544,7 @@ "scope": "per_value" } }, - "id": 9, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -33467,7 +33597,7 @@ "payload": { "NonASAP": { "Sort": { - "child": 8, + "child": 9, "keys": [ { "ascending": false, @@ -33503,7 +33633,7 @@ "scope": "per_value" } }, - "id": 10, + "id": 11, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -33556,7 +33686,7 @@ "payload": { "NonASAP": { "Limit": { - "child": 9, + "child": 10, "n": 10, "offset": 0, "partition_by": [ @@ -33585,7 +33715,7 @@ "scope": "per_value" } }, - "id": 11, + "id": 12, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -33617,7 +33747,7 @@ "payload": { "NonASAP": { "Project": { - "child": 10, + "child": 11, "cols": [ { "alias": "job", @@ -33640,13 +33770,13 @@ ], "roots": [ 5, - 11 + 12 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L7", - "id": "P7" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L5", + "id": "P5-m1" }, { "dag": { @@ -33709,7 +33839,7 @@ { "consumer": 2, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -33726,12 +33856,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -34383,7 +34510,24 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 1, "materialization": "NotMaterialized", "output_schema": { @@ -34399,12 +34543,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -34434,33 +34575,18 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 0, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": "PerEntity" + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } } } } @@ -34522,10 +34648,26 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 1 - ] + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" } } } @@ -35335,9 +35477,9 @@ ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes", - "from_logical": "L8", - "id": "P8" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes", + "from_logical": "L6", + "id": "P6" }, { "dag": { @@ -35399,6 +35541,61 @@ }, { "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -35451,14 +35648,14 @@ ] ] }, - "producer": 1, + "producer": 2, "role": "Input", "window": "NotApplicable" }, { - "consumer": 3, + "consumer": 4, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -35473,16 +35670,109 @@ "nullable": false, "table": null }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, { "dtype": { "ExactAggregate": [ - "Rate", - "Rate" + "Sum", + "Sum" ] }, "name": "state", "nullable": false, "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null }, { "dtype": { @@ -35509,166 +35799,15 @@ ] ] }, - "producer": 2, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 4, - "data_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "producer": 3, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 5, - "data_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] - }, - "name": "state", - "nullable": false, - "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "producer": 4, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 6, - "data_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "producer": 0, + "producer": 6, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -35718,12 +35857,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -35776,12 +35915,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -35831,12 +35970,12 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" }, { - "consumer": 10, + "consumer": 11, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -35886,12 +36025,12 @@ ] ] }, - "producer": 9, + "producer": 10, "role": "Input", "window": "NotApplicable" }, { - "consumer": 11, + "consumer": 12, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -35941,7 +36080,7 @@ ] ] }, - "producer": 10, + "producer": 11, "role": "Input", "window": "NotApplicable" } @@ -36074,9 +36213,91 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 1, "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -36130,8 +36351,8 @@ }, "payload": { "ASAP": { - "PaneChain": { - "child": 0, + "SummaryAgg": { + "child": 1, "family": { "ExactAggregate": [ "Rate", @@ -36149,78 +36370,11 @@ "kind": "unknown_or_signed" } }, - "pane_count": 6, - "pane_width_ms": 10000, "reduction": "PerEntity" } } } }, - { - "guarantee": null, - "id": 2, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "name": "state", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "output_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryMerge": { - "children": [ - 1 - ] - } - } - } - }, { "guarantee": { "provenance": [ @@ -36427,7 +36581,24 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", "output_schema": { @@ -36443,12 +36614,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -36478,33 +36646,62 @@ ] }, "output_state": { - "primitive": "SummaryState", - "timing": "query_time" + "primitive": "Raw", + "timing": "ingestion_time" }, "payload": { - "ASAP": { - "PaneChain": { - "child": 0, - "family": { - "ExactAggregate": [ - "Sum", - "Sum" + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] ] }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" + "source": { + "TimeSeries": { + "metric": "http_requests_total" } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": "PerEntity" + } } } } @@ -36512,7 +36709,9 @@ { "guarantee": null, "id": 7, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -36562,37 +36761,38 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 6 - ] + "PaneChain": { + "child": 6, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact accumulator over exact input" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 8, "materialization": "NotMaterialized", "output_schema": { @@ -36608,9 +36808,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -36640,13 +36843,15 @@ ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { "ASAP": { - "FinalizeExactAccumulator": { - "child": 7 + "SummaryMerge": { + "children": [ + 7 + ] } } } @@ -36721,21 +36926,9 @@ "timing": "query_time" }, "payload": { - "NonASAP": { - "Sort": { - "child": 8, - "keys": [ - { - "ascending": false, - "expr": { - "Column": 1 - }, - "nulls_first": false - } - ], - "partition_by": [ - 2 - ] + "ASAP": { + "FinalizeExactAccumulator": { + "child": 8 } } } @@ -36745,7 +36938,7 @@ "provenance": [ { "kind": "exact", - "reason": "exact over exact inputs" + "reason": "exact accumulator over exact input" } ], "spec": { @@ -36811,10 +37004,17 @@ }, "payload": { "NonASAP": { - "Limit": { + "Sort": { "child": 9, - "n": 10, - "offset": 0, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], "partition_by": [ 2 ] @@ -36843,6 +37043,88 @@ }, "id": 11, "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -36873,7 +37155,7 @@ "payload": { "NonASAP": { "Project": { - "child": 10, + "child": 11, "cols": [ { "alias": "job", @@ -36896,13 +37178,13 @@ ], "roots": [ 5, - 11 + 12 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L9", - "id": "P9" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes · ingestion time: Sum acc ×6 panes", + "from_logical": "L6", + "id": "P6-m1" }, { "dag": { @@ -37172,7 +37454,7 @@ "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 6, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -37222,6 +37504,64 @@ ] ] }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, "producer": 6, "role": "Input", "window": "NotApplicable" @@ -37229,7 +37569,7 @@ { "consumer": 8, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -37246,9 +37586,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -37284,13 +37627,29 @@ { "consumer": 9, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -37301,29 +37660,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -37342,6 +37689,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -37354,14 +37717,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -37369,6 +37733,61 @@ "producer": 9, "role": "Input", "window": "NotApplicable" + }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" } ], "nodes": [ @@ -37867,24 +38286,7 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 6, "materialization": "NotMaterialized", "output_schema": { @@ -37900,9 +38302,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -37932,62 +38337,98 @@ ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" ] }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" } - } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] } } } @@ -37997,7 +38438,7 @@ "provenance": [ { "kind": "exact", - "reason": "exact over exact inputs" + "reason": "exact accumulator over exact input" } ], "spec": { @@ -38011,7 +38452,7 @@ "scope": "per_value" } }, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -38062,25 +38503,53 @@ "timing": "query_time" }, "payload": { - "NonASAP": { - "TimeRange": { - "child": 6, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "ASAP": { + "FinalizeExactAccumulator": { + "child": 7 } } } }, { - "guarantee": null, - "id": 8, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -38091,89 +38560,85 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "SummaryAgg": { - "child": 7, - "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } + "NonASAP": { + "Sort": { + "child": 8, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "nulls_first": false } - }, - "reduction": { - "Reduce": [ - 2 - ] - } + ], + "partition_by": [ + 2 + ] } } } }, { - "guarantee": null, - "id": 9, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -38186,14 +38651,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -38203,21 +38669,38 @@ "timing": "query_time" }, "payload": { - "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 8 + "NonASAP": { + "Limit": { + "child": 9, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] } } } }, { - "guarantee": null, - "id": 10, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -38232,7 +38715,7 @@ }, { "dtype": { - "Plain": "utf8" + "Plain": "float64" }, "name": "topk_10", "nullable": false, @@ -38240,11 +38723,7 @@ } ], "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] + "unique_keys": [] }, "output_state": { "primitive": "Raw", @@ -38253,12 +38732,12 @@ "payload": { "NonASAP": { "Project": { - "child": 9, + "child": 10, "cols": [ { "alias": "job", "expr": { - "Column": 0 + "Column": 2 } }, { @@ -38276,13 +38755,13 @@ ], "roots": [ 5, - 10 + 11 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap", - "from_logical": "L10", - "id": "P10" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L7", + "id": "P7" }, { "dag": { @@ -38552,10 +39031,10 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -38602,15 +39081,15 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { - "consumer": 7, + "consumer": 8, "data_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -38626,9 +39105,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -38657,12 +39139,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -38671,6 +39153,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -38681,39 +39182,27 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -38722,6 +39211,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -38734,46 +39239,31 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -38817,7 +39307,133 @@ ] ] }, - "output_state": { + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { "primitive": "Raw", "timing": "query_time" }, @@ -39313,16 +39929,60 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } } } } @@ -39331,10 +39991,31 @@ { "guarantee": null, "id": 7, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -39345,78 +40026,49 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { - "SummaryAgg": { + "PaneChain": { "child": 6, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, - "reduction": { - "Reduce": [ - 2 - ] - } + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -39430,52 +40082,23 @@ "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { - "Plain": "utf8" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "topk", + "name": "state", "nullable": false, "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 7 - } - } - } - }, - { - "guarantee": null, - "id": 9, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ + }, { "dtype": { "Plain": "utf8" @@ -39488,67 +40111,55 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "Project": { - "child": 8, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, - { - "alias": "topk_10", - "expr": { - "Column": 1 - } - } - ], - "qualifier": null + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] } } } - } - ], - "roots": [ - 5, - 9 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · shared Scan #1", - "from_logical": "L11", - "id": "P11" - }, - { - "dag": { - "edges": [ + }, { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -39592,18 +40203,129 @@ ] ] }, - "producer": 0, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 8 + } + } + } }, { - "consumer": 2, - "data_state": { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "payload": { + "NonASAP": { + "Sort": { + "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -39647,14 +40369,112 @@ ] ] }, - "producer": 1, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } }, { - "consumer": 3, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 12 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Sum acc for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Sum acc ×6 panes", + "from_logical": "L7", + "id": "P7-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -39671,12 +40491,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -39705,14 +40522,14 @@ ] ] }, - "producer": 2, + "producer": 0, "role": "Input", "window": "NotApplicable" }, { - "consumer": 4, + "consumer": 2, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -39729,9 +40546,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -39760,12 +40580,12 @@ ] ] }, - "producer": 3, + "producer": 1, "role": "Input", "window": "NotApplicable" }, { - "consumer": 5, + "consumer": 3, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -39776,37 +40596,54 @@ "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 4, + "producer": 2, "role": "Input", "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 4, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -39856,12 +40693,12 @@ ] ] }, - "producer": 1, + "producer": 3, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 5, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -39880,19 +40717,9 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", @@ -39907,12 +40734,12 @@ ] ] }, - "producer": 6, + "producer": 4, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -39921,6 +40748,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -39933,46 +40776,31 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 7, + "producer": 6, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -39985,9 +40813,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -40016,89 +40847,18 @@ ] ] }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" - } - } - } - } - } + "producer": 7, + "role": "Input", + "window": "NotApplicable" }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" }, - "id": 1, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -40111,9 +40871,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -40142,28 +40905,18 @@ ] ] }, - "output_state": { + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { "primitive": "Raw", "timing": "query_time" }, - "payload": { - "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } - } - } - } - }, - { - "guarantee": null, - "id": 2, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -40176,12 +40929,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -40210,42 +40960,128 @@ ] ] }, - "output_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "producer": 9, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" }, - "reduction": "PerEntity" + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } - } - } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" }, + { + "consumer": 12, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ { "guarantee": { "provenance": [ { "kind": "exact", - "reason": "exact accumulator over exact input" + "reason": "exact over exact inputs" } ], "spec": { @@ -40259,7 +41095,7 @@ "scope": "per_value" } }, - "id": 3, + "id": 0, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -40310,43 +41146,109 @@ "timing": "query_time" }, "payload": { - "ASAP": { - "FinalizeExactAccumulator": { - "child": 2 + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } } } } }, { "guarantee": null, - "id": 4, + "id": 1, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -40357,12 +41259,12 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 3, + "PaneChain": { + "child": 0, "family": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "filter": null, @@ -40376,11 +41278,74 @@ "kind": "unknown_or_signed" } }, - "reduction": { - "Reduce": [ - 2 + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" ] - } + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -40404,11 +41369,27 @@ "scope": "per_value" } }, - "id": 5, + "id": 3, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -40419,16 +41400,17 @@ }, { "dtype": { - "Plain": "float64" + "Plain": "utf8" }, - "name": "sum", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -40440,14 +41422,14 @@ "payload": { "ASAP": { "FinalizeExactAccumulator": { - "child": 4 + "child": 2 } } } }, { "guarantee": null, - "id": 6, + "id": 4, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -40462,19 +41444,9 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", @@ -40496,37 +41468,22 @@ "payload": { "ASAP": { "SummaryAgg": { - "child": 1, + "child": 3, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, "reduction": { @@ -40539,8 +41496,25 @@ } }, { - "guarantee": null, - "id": 7, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -40555,9 +41529,9 @@ }, { "dtype": { - "Plain": "utf8" + "Plain": "float64" }, - "name": "topk", + "name": "sum", "nullable": false, "table": null } @@ -40575,97 +41549,34 @@ }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 6 + "FinalizeExactAccumulator": { + "child": 4 } } } }, { - "guarantee": null, - "id": 8, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, + "guarantee": { + "provenance": [ { - "dtype": { - "Plain": "utf8" - }, - "name": "topk_10", - "nullable": false, - "table": null + "kind": "exact", + "reason": "exact over exact inputs" } ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Project": { - "child": 7, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, - { - "alias": "topk_10", - "expr": { - "Column": 1 - } - } - ], - "qualifier": null - } + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" } - } - } - ], - "roots": [ - 5, - 8 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · shared Scan #1, TimeRange #2", - "from_logical": "L12", - "id": "P12" - }, - { - "dag": { - "edges": [ - { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -40709,24 +41620,78 @@ ] ] }, - "producer": 0, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 2, - "data_state": { - "primitive": "SummaryState", + "output_state": { + "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, "name": "ts", "nullable": false, "table": null @@ -40734,8 +41699,8 @@ { "dtype": { "ExactAggregate": [ - "Rate", - "Rate" + "Sum", + "Sum" ] }, "name": "state", @@ -40767,18 +41732,43 @@ ] ] }, - "producer": 1, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 3, - "data_state": { + "output_state": { "primitive": "SummaryState", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -40792,8 +41782,8 @@ { "dtype": { "ExactAggregate": [ - "Rate", - "Rate" + "Sum", + "Sum" ] }, "name": "state", @@ -40825,18 +41815,42 @@ ] ] }, - "producer": 2, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } }, { - "consumer": 4, - "data_state": { - "primitive": "Raw", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -40880,20 +41894,58 @@ ] ] }, - "producer": 3, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 8 + } + } + } }, { - "consumer": 5, - "data_state": { - "primitive": "SummaryState", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -40904,35 +41956,67 @@ }, { "dtype": { - "ExactAggregate": [ - "Sum", - "Sum" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 4, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 7, - "data_state": { + "output_state": { "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "payload": { + "NonASAP": { + "Sort": { + "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -40976,12 +42060,110 @@ ] ] }, - "producer": 6, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } }, { - "consumer": 8, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 12 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes", + "from_logical": "L8", + "id": "P8" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -41031,12 +42213,12 @@ ] ] }, - "producer": 7, + "producer": 0, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 2, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -41045,6 +42227,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -41055,47 +42256,54 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 8, + "producer": 1, "role": "Input", "window": "NotApplicable" }, { - "consumer": 10, + "consumer": 3, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -41108,46 +42316,31 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 9, + "producer": 2, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -41191,22 +42384,470 @@ ] ] }, - "output_state": { - "primitive": "Raw", + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", "timing": "query_time" }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", "nullable": false, "table": null }, @@ -41672,7 +43313,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -41732,26 +43373,11 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 7, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -41765,9 +43391,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -41797,18 +43426,33 @@ ] }, "output_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "payload": { - "NonASAP": { - "TimeRange": { + "ASAP": { + "PaneChain": { "child": 6, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -41820,6 +43464,25 @@ "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -41830,29 +43493,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -41863,56 +43514,54 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 7, - "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" - } - }, - "reduction": { - "Reduce": [ - 2 - ] - } + "SummaryMerge": { + "children": [ + 7 + ] } } } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -41925,14 +43574,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -41943,24 +43593,52 @@ }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 8 + "FinalizeExactAccumulator": { + "child": 8 } } } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -41973,14 +43651,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -41991,13 +43670,163 @@ }, "payload": { "NonASAP": { - "Project": { + "Sort": { "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, "cols": [ { "alias": "job", "expr": { - "Column": 0 + "Column": 2 } }, { @@ -42015,13 +43844,13 @@ ], "roots": [ 5, - 10 + 12 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes", - "from_logical": "L13", - "id": "P13" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · ingestion time: Sum acc ×6 panes", + "from_logical": "L8", + "id": "P8-m1" }, { "dag": { @@ -42030,7 +43859,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -42079,13 +43908,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -42294,7 +44123,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -42344,14 +44173,14 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -42368,9 +44197,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -42399,12 +44231,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -42413,6 +44245,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -42423,39 +44274,27 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -42464,6 +44303,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -42476,46 +44331,31 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -42559,59 +44399,185 @@ ] ] }, - "output_state": { + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { "primitive": "Raw", "timing": "query_time" }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" }, - "source": { + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { "TimeSeries": { "metric": "http_requests_total" } @@ -42623,7 +44589,9 @@ { "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -42673,7 +44641,7 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { @@ -43044,12 +45012,56 @@ }, "payload": { "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } } } } @@ -43062,6 +45074,25 @@ "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -43072,29 +45103,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -43105,45 +45124,28 @@ }, "payload": { "ASAP": { - "SummaryAgg": { + "PaneChain": { "child": 6, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, - "reduction": { - "Reduce": [ - 2 - ] - } + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -43157,52 +45159,23 @@ "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { - "Plain": "utf8" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "topk", + "name": "state", "nullable": false, "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 7 - } - } - } - }, - { - "guarantee": null, - "id": 9, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ + }, { "dtype": { "Plain": "utf8" @@ -43215,67 +45188,55 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "Project": { - "child": 8, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, - { - "alias": "topk_10", - "expr": { - "Column": 1 - } - } - ], - "qualifier": null + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] } } } - } - ], - "roots": [ - 5, - 9 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", - "from_logical": "L14", - "id": "P14" - }, - { - "dag": { - "edges": [ + }, { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -43319,18 +45280,40 @@ ] ] }, - "producer": 0, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 2, - "data_state": { + "output_state": { "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 8 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -43374,18 +45357,52 @@ ] ] }, - "producer": 1, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Sort": { + "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } }, { - "consumer": 3, - "data_state": { - "primitive": "SummaryState", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -43398,12 +45415,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -43432,7 +45446,276 @@ ] ] }, - "producer": 2, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 12 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L8", + "id": "P8-m2" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, "role": "Input", "window": "NotApplicable" }, @@ -43536,7 +45819,7 @@ "consumer": 7, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -43585,18 +45868,37 @@ }, "producer": 6, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 8, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -43607,29 +45909,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -43648,6 +45938,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -43658,29 +45967,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -43699,6 +45996,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -43711,14 +46024,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -43726,6 +46040,116 @@ "producer": 9, "role": "Input", "window": "NotApplicable" + }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" } ], "nodes": [ @@ -43796,7 +46220,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -43856,26 +46280,11 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -43889,9 +46298,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -43921,18 +46333,33 @@ ] }, "output_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "payload": { - "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -43994,26 +46421,10 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "reduction": "PerEntity" + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -44290,7 +46701,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -44352,10 +46763,31 @@ { "guarantee": null, "id": 7, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -44366,80 +46798,49 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { "PaneChain": { "child": 6, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, "pane_count": 6, "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] - } + "reduction": "PerEntity" } } } @@ -44453,62 +46854,23 @@ "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", "nullable": false, "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryMerge": { - "children": [ - 7 - ] - } - } - } - }, - { - "guarantee": null, - "id": 9, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ + }, { "dtype": { "Plain": "utf8" @@ -44521,115 +46883,55 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 8 + "SummaryMerge": { + "children": [ + 7 + ] } } } }, { - "guarantee": null, - "id": 10, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, + "guarantee": { + "provenance": [ { - "dtype": { - "Plain": "utf8" - }, - "name": "topk_10", - "nullable": false, - "table": null + "kind": "exact", + "reason": "exact accumulator over exact input" } ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Project": { - "child": 9, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, - { - "alias": "topk_10", - "expr": { - "Column": 1 - } - } - ], - "qualifier": null - } + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" } - } - } - ], - "roots": [ - 5, - 10 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes", - "from_logical": "L15", - "id": "P15" - }, - { - "dag": { - "edges": [ - { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -44673,18 +46975,40 @@ ] ] }, - "producer": 0, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 2, - "data_state": { + "output_state": { "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 8 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -44728,18 +47052,52 @@ ] ] }, - "producer": 1, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Sort": { + "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } }, { - "consumer": 3, - "data_state": { - "primitive": "SummaryState", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -44752,12 +47110,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -44786,12 +47141,110 @@ ] ] }, - "producer": 2, - "role": "Input", - "window": "NotApplicable" + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } }, { - "consumer": 4, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 12 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes, Sum acc ×6 panes", + "from_logical": "L8", + "id": "P8-m3" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -44841,12 +47294,12 @@ ] ] }, - "producer": 3, + "producer": 0, "role": "Input", "window": "NotApplicable" }, { - "consumer": 5, + "consumer": 2, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -44857,39 +47310,56 @@ "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 4, + "producer": 1, "role": "Input", "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 3, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -44906,9 +47376,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -44937,20 +47410,36 @@ ] ] }, - "producer": 0, + "producer": 2, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 4, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -44961,39 +47450,27 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 6, + "producer": 3, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 5, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -45012,19 +47489,9 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", @@ -45039,12 +47506,12 @@ ] ] }, - "producer": 7, + "producer": 4, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 6, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -45053,6 +47520,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -45065,46 +47548,31 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 8, + "producer": 0, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -45117,9 +47585,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -45148,89 +47619,18 @@ ] ] }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" - } - } - } - } - } + "producer": 6, + "role": "Input", + "window": "NotApplicable" }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" }, - "id": 1, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -45243,9 +47643,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -45274,28 +47677,18 @@ ] ] }, - "output_state": { + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { "primitive": "Raw", "timing": "query_time" }, - "payload": { - "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } - } - } - } - }, - { - "guarantee": null, - "id": 2, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -45308,12 +47701,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -45342,42 +47732,128 @@ ] ] }, - "output_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" }, - "reduction": "PerEntity" + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } - } - } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ { "guarantee": { "provenance": [ { "kind": "exact", - "reason": "exact accumulator over exact input" + "reason": "exact over exact inputs" } ], "spec": { @@ -45391,7 +47867,7 @@ "scope": "per_value" } }, - "id": 3, + "id": 0, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -45442,43 +47918,109 @@ "timing": "query_time" }, "payload": { - "ASAP": { - "FinalizeExactAccumulator": { - "child": 2 + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } } } } }, { "guarantee": null, - "id": 4, + "id": 1, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ { "dtype": { - "Plain": "utf8" + "Plain": "timestamp" }, - "name": "job", - "nullable": true, + "name": "ts", + "nullable": false, "table": null }, { "dtype": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -45489,12 +48031,12 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 3, + "PaneChain": { + "child": 0, "family": { "ExactAggregate": [ - "Sum", - "Sum" + "Rate", + "Rate" ] }, "filter": null, @@ -45508,11 +48050,74 @@ "kind": "unknown_or_signed" } }, - "reduction": { - "Reduce": [ - 2 + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" ] - } + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -45536,11 +48141,27 @@ "scope": "per_value" } }, - "id": 5, + "id": 3, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -45551,16 +48172,17 @@ }, { "dtype": { - "Plain": "float64" + "Plain": "utf8" }, - "name": "sum", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -45572,14 +48194,14 @@ "payload": { "ASAP": { "FinalizeExactAccumulator": { - "child": 4 + "child": 2 } } } }, { "guarantee": null, - "id": 6, + "id": 4, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -45594,19 +48216,9 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", @@ -45627,42 +48239,25 @@ }, "payload": { "ASAP": { - "PaneChain": { - "child": 0, + "SummaryAgg": { + "child": 3, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, - "pane_count": 6, - "pane_width_ms": 10000, "reduction": { "Reduce": [ 2 @@ -45673,8 +48268,25 @@ } }, { - "guarantee": null, - "id": 7, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -45689,22 +48301,9 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "float64" }, - "name": "state", + "name": "sum", "nullable": false, "table": null } @@ -45717,26 +48316,43 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 6 - ] + "FinalizeExactAccumulator": { + "child": 4 } } } }, { "guarantee": null, - "id": 8, + "id": 6, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -45749,42 +48365,77 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" } }, - "summary_input": 7 + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } }, { "guarantee": null, - "id": 9, + "id": 7, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -45797,31 +48448,338 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "Project": { - "child": 8, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 7 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Sort": { + "child": 8, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Limit": { + "child": 9, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 10, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 } }, { @@ -45839,13 +48797,13 @@ ], "roots": [ 5, - 9 + 11 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L16", - "id": "P16" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L9", + "id": "P9" }, { "dag": { @@ -46121,7 +49079,7 @@ "consumer": 7, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -46170,18 +49128,37 @@ }, "producer": 6, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 8, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -46192,29 +49169,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -46233,6 +49198,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -46243,29 +49227,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -46284,6 +49256,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -46296,14 +49284,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -46311,31 +49300,15 @@ "producer": 9, "role": "Input", "window": "NotApplicable" - } - ], - "nodes": [ + }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" }, - "id": 0, - "materialization": "NotMaterialized", - "output_schema": { + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -46379,60 +49352,186 @@ ] ] }, - "output_state": { + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { "primitive": "Raw", "timing": "query_time" }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { "metric": "http_requests_total" } } @@ -46860,7 +49959,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -46922,10 +50021,31 @@ { "guarantee": null, "id": 7, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -46936,80 +50056,49 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { "PaneChain": { "child": 6, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, "pane_count": 6, "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] - } + "reduction": "PerEntity" } } } @@ -47021,6 +50110,25 @@ "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47031,29 +50139,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -47073,12 +50169,45 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47091,14 +50220,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -47109,24 +50239,52 @@ }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 8 + "FinalizeExactAccumulator": { + "child": 8 } } } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47139,14 +50297,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -47157,49 +50316,46 @@ }, "payload": { "NonASAP": { - "Project": { + "Sort": { "child": 9, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, + "keys": [ { - "alias": "topk_10", + "ascending": false, "expr": { "Column": 1 - } + }, + "nulls_first": false } ], - "qualifier": null + "partition_by": [ + 2 + ] } } } - } - ], - "roots": [ - 5, - 10 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes", - "from_logical": "L17", - "id": "P17" - }, - { - "dag": { - "edges": [ + }, { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 11, + "materialization": "NotMaterialized", + "output_schema": { "closed": true, "fields": [ { @@ -47243,39 +50399,47 @@ ] ] }, - "producer": 0, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 2, - "data_state": { - "primitive": "SummaryState", + "output_state": { + "primitive": "Raw", "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" }, - { - "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "name": "state", - "nullable": false, - "table": null + "failure_probability": { + "op": "zero" }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ { "dtype": { "Plain": "utf8" @@ -47286,23 +50450,168 @@ }, { "dtype": { - "Plain": "utf8" + "Plain": "float64" }, - "name": "$promql_series_identity", + "name": "topk_10", "nullable": false, "table": null } ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] + "time_index": null, + "unique_keys": [] }, - "producer": 1, - "role": "Input", + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 11, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 2 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 12 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Sum acc ×6 panes", + "from_logical": "L9", + "id": "P9-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", "window": "NotApplicable" }, { @@ -47460,7 +50769,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -47510,12 +50819,12 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -47524,6 +50833,25 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47534,47 +50862,109 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 6, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 10, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47585,39 +50975,27 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 7, + "producer": 9, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 11, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -47626,6 +51004,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -47638,19 +51032,75 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, - "producer": 8, + "producer": 10, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 12, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 11, "role": "Input", "window": "NotApplicable" } @@ -47723,7 +51173,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -47785,7 +51235,9 @@ { "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -47835,7 +51287,7 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { @@ -48136,12 +51588,45 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48152,29 +51637,129 @@ }, { "dtype": { - "Sketch": [ + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null }, - "PerSubpopulationInstance" + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" ] }, "name": "state", "nullable": false, "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48186,57 +51771,57 @@ "payload": { "ASAP": { "PaneChain": { - "child": 0, + "child": 6, "family": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" + "ExactAggregate": [ + "Sum", + "Sum" ] }, "filter": null, "grouping": "PerSubpopulationInstance", "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, + "item": null, "weight": { "Column": "SampleValue" }, "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "kind": "unknown_or_signed" } }, "pane_count": 6, "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] - } + "reduction": "PerEntity" } } } }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48247,29 +51832,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CmsWithHeap", - "category": "TopK", - "params": { - "CmsWithHeap": { - "depth": 7, - "heap_size": 100, - "width": 272 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48282,19 +51855,52 @@ "ASAP": { "SummaryMerge": { "children": [ - 6 + 7 ] } } } }, { - "guarantee": null, - "id": 8, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48307,14 +51913,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48325,24 +51932,141 @@ }, "payload": { "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } + "FinalizeExactAccumulator": { + "child": 8 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" }, - "summary_input": 7 + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Sort": { + "child": 9, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 + }, + "nulls_first": false + } + ], + "partition_by": [ + 2 + ] } } } }, { - "guarantee": null, - "id": 9, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48355,14 +52079,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk_10", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48371,15 +52096,76 @@ "primitive": "Raw", "timing": "query_time" }, + "payload": { + "NonASAP": { + "Limit": { + "child": 10, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 12, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, "payload": { "NonASAP": { "Project": { - "child": 8, + "child": 11, "cols": [ { "alias": "job", "expr": { - "Column": 0 + "Column": 2 } }, { @@ -48397,13 +52183,13 @@ ], "roots": [ 5, - 9 + 12 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L18", - "id": "P18" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L9", + "id": "P9-m2" }, { "dag": { @@ -48412,7 +52198,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -48461,13 +52247,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -48483,9 +52269,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -48673,10 +52462,10 @@ "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 6, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -48723,15 +52512,15 @@ ] ] }, - "producer": 6, + "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { - "consumer": 8, + "consumer": 7, "data_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -48747,9 +52536,70 @@ }, { "dtype": { - "Plain": "float64" - }, - "name": "value", + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", "nullable": false, "table": null }, @@ -48785,13 +52635,29 @@ { "consumer": 9, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48802,29 +52668,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48843,6 +52697,22 @@ "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -48855,14 +52725,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -48870,6 +52741,61 @@ "producer": 9, "role": "Input", "window": "NotApplicable" + }, + { + "consumer": 11, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 10, + "role": "Input", + "window": "NotApplicable" } ], "nodes": [ @@ -48940,7 +52866,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -49000,26 +52926,11 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -49033,9 +52944,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -49065,18 +52979,33 @@ ] }, "output_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "payload": { - "NonASAP": { - "TimeRange": { + "ASAP": { + "PaneChain": { "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -49138,26 +53067,10 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "reduction": "PerEntity" + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -49368,25 +53281,93 @@ } }, { - "guarantee": { - "provenance": [ + "guarantee": null, + "id": 6, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null }, - "failure_probability": { - "op": "zero" + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null }, - "metric": "absolute", - "scope": "per_value" - } + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] }, - "id": 6, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 7, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -49401,9 +53382,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Sum", + "Sum" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -49433,62 +53417,15 @@ ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" - } - } + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] } } } @@ -49498,7 +53435,7 @@ "provenance": [ { "kind": "exact", - "reason": "exact over exact inputs" + "reason": "exact accumulator over exact input" } ], "spec": { @@ -49512,7 +53449,7 @@ "scope": "per_value" } }, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -49563,25 +53500,53 @@ "timing": "query_time" }, "payload": { - "NonASAP": { - "TimeRange": { - "child": 6, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "ASAP": { + "FinalizeExactAccumulator": { + "child": 7 } } } }, { - "guarantee": null, - "id": 8, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -49592,89 +53557,85 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "SummaryAgg": { - "child": 7, - "family": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } + "NonASAP": { + "Sort": { + "child": 8, + "keys": [ + { + "ascending": false, + "expr": { + "Column": 1 }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" + "nulls_first": false } - }, - "reduction": { - "Reduce": [ - 2 - ] - } + ], + "partition_by": [ + 2 + ] } } } }, { - "guarantee": null, - "id": 9, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -49687,14 +53648,15 @@ "dtype": { "Plain": "utf8" }, - "name": "topk", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -49704,21 +53666,38 @@ "timing": "query_time" }, "payload": { - "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 8 + "NonASAP": { + "Limit": { + "child": 9, + "n": 10, + "offset": 0, + "partition_by": [ + 2 + ] } } } }, { - "guarantee": null, - "id": 10, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 11, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -49733,7 +53712,7 @@ }, { "dtype": { - "Plain": "utf8" + "Plain": "float64" }, "name": "topk_10", "nullable": false, @@ -49741,11 +53720,7 @@ } ], "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] + "unique_keys": [] }, "output_state": { "primitive": "Raw", @@ -49754,12 +53729,12 @@ "payload": { "NonASAP": { "Project": { - "child": 9, + "child": 10, "cols": [ { "alias": "job", "expr": { - "Column": 0 + "Column": 2 } }, { @@ -49777,13 +53752,13 @@ ], "roots": [ 5, - 10 + 11 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap", - "from_logical": "L19", - "id": "P19" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc) · Rate acc for Q1 in 6 × 10s panes, Sum acc for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes, Sum acc ×6 panes", + "from_logical": "L9", + "id": "P9-m3" }, { "dag": { @@ -50053,7 +54028,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -50103,12 +54078,12 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -50158,12 +54133,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -50184,13 +54159,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -50209,12 +54184,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -50247,7 +54222,7 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" } @@ -50818,238 +54793,364 @@ }, "payload": { "NonASAP": { - "TimeRange": { - "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } - } - } - } - }, - { - "guarantee": null, - "id": 7, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Sketch": [ + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null }, - "PerSubpopulationInstance" - ] - }, - "name": "state", - "nullable": false, - "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "SummaryState", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryAgg": { - "child": 6, - "family": { - "Sketch": [ { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null }, - "PerSubpopulationInstance" + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] ] }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", + "source": { + "TimeSeries": { "metric": "http_requests_total" } - }, - "reduction": { - "Reduce": [ - 2 - ] } } } } }, { - "guarantee": null, - "id": 8, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, + "guarantee": { + "provenance": [ { - "dtype": { - "Plain": "utf8" - }, - "name": "topk", - "nullable": false, - "table": null + "kind": "exact", + "reason": "exact over exact inputs" } ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "ASAP": { - "SummaryEstimate": { - "query": { - "TopK": { - "k": 10 - } - }, - "summary_input": 7 - } - } - } - }, - { - "guarantee": null, - "id": 9, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null + "spec": { + "error": { + "op": "zero" }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "topk_10", - "nullable": false, - "table": null - } - ], - "time_index": null, - "unique_keys": [ - [ - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Project": { - "child": 8, - "cols": [ - { - "alias": "job", - "expr": { - "Column": 0 - } - }, - { - "alias": "topk_10", - "expr": { - "Column": 1 - } - } - ], - "qualifier": null - } + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" } - } - } - ], - "roots": [ - 5, - 9 - ], - "scalar_roots": [] - }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · shared Scan #1", - "from_logical": "L20", - "id": "P20" - }, - { - "dag": { - "edges": [ - { - "consumer": 1, - "data_state": { - "primitive": "Raw", - "timing": "query_time" }, - "grouping": "NotApplicable", - "intermediate_schema": { + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap", + "from_logical": "L10", + "id": "P10" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { "closed": true, "fields": [ { @@ -51357,12 +55458,67 @@ ] ] }, - "producer": 1, + "producer": 0, "role": "Input", "window": "NotApplicable" }, { "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -51383,13 +55539,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -51408,12 +55564,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -51446,7 +55602,7 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" } @@ -51947,9 +56103,91 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -51965,13 +56203,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -51997,17 +56235,17 @@ "payload": { "ASAP": { "SummaryAgg": { - "child": 1, + "child": 6, "family": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -52041,7 +56279,7 @@ }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -52082,14 +56320,14 @@ "k": 10 } }, - "summary_input": 6 + "summary_input": 7 } } } }, { "guarantee": null, - "id": 8, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -52125,7 +56363,7 @@ "payload": { "NonASAP": { "Project": { - "child": 7, + "child": 8, "cols": [ { "alias": "job", @@ -52148,13 +56386,13 @@ ], "roots": [ 5, - 8 + 9 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · shared Scan #1, TimeRange #2", - "from_logical": "L21", - "id": "P21" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · shared Scan #1", + "from_logical": "L11", + "id": "P11" }, { "dag": { @@ -52217,7 +56455,7 @@ { "consumer": 2, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -52234,12 +56472,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -52427,62 +56662,7 @@ "window": "NotApplicable" }, { - "consumer": 7, - "data_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "grouping": "NotApplicable", - "intermediate_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "producer": 6, - "role": "Input", - "window": "NotApplicable" - }, - { - "consumer": 8, + "consumer": 6, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -52532,12 +56712,12 @@ ] ] }, - "producer": 7, + "producer": 1, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 7, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -52558,13 +56738,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -52583,12 +56763,12 @@ ] ] }, - "producer": 8, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 10, + "consumer": 8, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -52621,7 +56801,7 @@ ] ] }, - "producer": 9, + "producer": 7, "role": "Input", "window": "NotApplicable" } @@ -52754,7 +56934,24 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 1, "materialization": "NotMaterialized", "output_schema": { @@ -52770,12 +56967,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -52805,33 +56999,18 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 0, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": "PerEntity" + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } } } } @@ -52893,10 +57072,26 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 1 - ] + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" } } } @@ -53106,217 +57301,9 @@ } } }, - { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, - "id": 6, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "Scan": { - "predicates": [], - "schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "source": { - "TimeSeries": { - "metric": "http_requests_total" - } - } - } - } - } - }, - { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, - "id": 7, - "materialization": "NotMaterialized", - "output_schema": { - "closed": true, - "fields": [ - { - "dtype": { - "Plain": "timestamp" - }, - "name": "ts", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "float64" - }, - "name": "value", - "nullable": false, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "job", - "nullable": true, - "table": null - }, - { - "dtype": { - "Plain": "utf8" - }, - "name": "$promql_series_identity", - "nullable": false, - "table": null - } - ], - "time_index": 0, - "unique_keys": [ - [ - 3, - 0 - ] - ] - }, - "output_state": { - "primitive": "Raw", - "timing": "query_time" - }, - "payload": { - "NonASAP": { - "TimeRange": { - "child": 6, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } - } - } - } - }, { "guarantee": null, - "id": 8, + "id": 6, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -53333,13 +57320,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -53365,17 +57352,17 @@ "payload": { "ASAP": { "SummaryAgg": { - "child": 7, + "child": 1, "family": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -53409,7 +57396,7 @@ }, { "guarantee": null, - "id": 9, + "id": 7, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -53450,14 +57437,14 @@ "k": 10 } }, - "summary_input": 8 + "summary_input": 6 } } } }, { "guarantee": null, - "id": 10, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -53493,7 +57480,7 @@ "payload": { "NonASAP": { "Project": { - "child": 9, + "child": 7, "cols": [ { "alias": "job", @@ -53516,13 +57503,13 @@ ], "roots": [ 5, - 10 + 8 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes", - "from_logical": "L22", - "id": "P22" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · shared Scan #1, TimeRange #2", + "from_logical": "L12", + "id": "P12" }, { "dag": { @@ -53795,7 +57782,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -53845,12 +57832,12 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -53900,12 +57887,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -53926,13 +57913,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -53951,12 +57938,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -53989,7 +57976,7 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" } @@ -54543,10 +58530,136 @@ "primitive": "Raw", "timing": "query_time" }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, "payload": { "NonASAP": { "TimeRange": { - "child": 0, + "child": 6, "kind": "range", "range": { "nanos": 0, @@ -54558,7 +58671,7 @@ }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -54575,13 +58688,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -54607,17 +58720,17 @@ "payload": { "ASAP": { "SummaryAgg": { - "child": 6, + "child": 7, "family": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -54651,7 +58764,7 @@ }, { "guarantee": null, - "id": 8, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -54692,14 +58805,14 @@ "k": 10 } }, - "summary_input": 7 + "summary_input": 8 } } } }, { "guarantee": null, - "id": 9, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -54735,7 +58848,7 @@ "payload": { "NonASAP": { "Project": { - "child": 8, + "child": 9, "cols": [ { "alias": "job", @@ -54758,13 +58871,13 @@ ], "roots": [ 5, - 9 + 10 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", - "from_logical": "L23", - "id": "P23" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes", + "from_logical": "L13", + "id": "P13" }, { "dag": { @@ -54773,7 +58886,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -54822,13 +58935,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -54844,9 +58957,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -55091,13 +59207,29 @@ { "consumer": 8, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -55108,29 +59240,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -55161,13 +59281,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -55297,7 +59417,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -55357,26 +59477,11 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -55390,9 +59495,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -55422,18 +59530,33 @@ ] }, "output_state": { - "primitive": "Raw", - "timing": "query_time" + "primitive": "SummaryState", + "timing": "ingestion_time" }, "payload": { - "NonASAP": { - "TimeRange": { + "ASAP": { + "PaneChain": { "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -55495,26 +59618,10 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "reduction": "PerEntity" + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -55851,12 +59958,45 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 7, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -55867,79 +60007,33 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 6, - "family": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 } } } @@ -55964,13 +60058,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -55995,10 +60089,45 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 7 - ] + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } } } } @@ -56116,9 +60245,9 @@ ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes", - "from_logical": "L24", - "id": "P24" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L13", + "id": "P13-m1" }, { "dag": { @@ -56181,7 +60310,7 @@ { "consumer": 2, "data_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "grouping": "NotApplicable", @@ -56198,9 +60327,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -56445,13 +60577,29 @@ { "consumer": 7, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -56462,29 +60610,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -56515,13 +60651,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -56711,24 +60847,7 @@ } }, { - "guarantee": { - "provenance": [ - { - "kind": "exact", - "reason": "exact over exact inputs" - } - ], - "spec": { - "error": { - "op": "zero" - }, - "failure_probability": { - "op": "zero" - }, - "metric": "absolute", - "scope": "per_value" - } - }, + "guarantee": null, "id": 1, "materialization": "NotMaterialized", "output_schema": { @@ -56744,9 +60863,12 @@ }, { "dtype": { - "Plain": "float64" + "ExactAggregate": [ + "Rate", + "Rate" + ] }, - "name": "value", + "name": "state", "nullable": false, "table": null }, @@ -56776,18 +60898,33 @@ ] }, "output_state": { - "primitive": "Raw", + "primitive": "SummaryState", "timing": "query_time" }, "payload": { - "NonASAP": { - "TimeRange": { + "ASAP": { + "PaneChain": { "child": 0, - "kind": "range", - "range": { - "nanos": 0, - "secs": 60 - } + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" } } } @@ -56849,26 +60986,10 @@ }, "payload": { "ASAP": { - "SummaryAgg": { - "child": 1, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "reduction": "PerEntity" + "SummaryMerge": { + "children": [ + 1 + ] } } } @@ -57079,12 +61200,45 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -57095,79 +61249,33 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 0, - "family": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 } } } @@ -57192,13 +61300,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -57223,10 +61331,45 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 6 - ] + "SummaryAgg": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } } } } @@ -57344,9 +61487,9 @@ ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L25", - "id": "P25" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", + "from_logical": "L14", + "id": "P14" }, { "dag": { @@ -57355,7 +61498,7 @@ "consumer": 1, "data_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -57404,13 +61547,13 @@ }, "producer": 0, "role": "Input", - "window": "NotApplicable" + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" }, { "consumer": 2, "data_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "grouping": "NotApplicable", "intermediate_schema": { @@ -57676,13 +61819,29 @@ { "consumer": 8, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", "intermediate_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -57693,29 +61852,17 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] @@ -57746,13 +61893,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -57882,7 +62029,7 @@ }, "output_state": { "primitive": "Raw", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "NonASAP": { @@ -57944,7 +62091,9 @@ { "guarantee": null, "id": 1, - "materialization": "NotMaterialized", + "materialization": { + "MatAtIngestion": "Memory" + }, "output_schema": { "closed": true, "fields": [ @@ -57994,7 +62143,7 @@ }, "output_state": { "primitive": "SummaryState", - "timing": "query_time" + "timing": "ingestion_time" }, "payload": { "ASAP": { @@ -58421,12 +62570,45 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 7, "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, { "dtype": { "Plain": "utf8" @@ -58437,79 +62619,33 @@ }, { "dtype": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] + "Plain": "utf8" }, - "name": "state", + "name": "$promql_series_identity", "nullable": false, "table": null } ], - "time_index": null, + "time_index": 0, "unique_keys": [ [ + 3, 0 ] ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 6, - "family": { - "Sketch": [ - { - "algorithm": "CountSketchWithHeap", - "category": "TopK", - "params": { - "CountSketchWithHeap": { - "depth": 149, - "heap_size": 100, - "width": 30000 - } - } - }, - "PerSubpopulationInstance" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": { - "Column": { - "Named": "$promql_series_identity" - } - }, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "samples_of_metric", - "metric": "http_requests_total" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": { - "Reduce": [ - 2 - ] + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 } } } @@ -58534,13 +62670,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -58565,10 +62701,45 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 7 - ] + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } } } } @@ -58686,9 +62857,9 @@ ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes", - "from_logical": "L26", - "id": "P26" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L14", + "id": "P14-m1" }, { "dag": { @@ -58751,7 +62922,7 @@ { "consumer": 2, "data_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "grouping": "NotApplicable", @@ -58768,12 +62939,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -58961,7 +63129,7 @@ "window": "NotApplicable" }, { - "consumer": 6, + "consumer": 7, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -59011,12 +63179,12 @@ ] ] }, - "producer": 0, + "producer": 6, "role": "Input", "window": "NotApplicable" }, { - "consumer": 7, + "consumer": 8, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -59037,13 +63205,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -59062,12 +63230,12 @@ ] ] }, - "producer": 6, + "producer": 7, "role": "Input", "window": "NotApplicable" }, { - "consumer": 8, + "consumer": 9, "data_state": { "primitive": "SummaryState", "timing": "query_time" @@ -59088,13 +63256,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -59113,12 +63281,12 @@ ] ] }, - "producer": 7, + "producer": 8, "role": "Input", "window": "NotApplicable" }, { - "consumer": 9, + "consumer": 10, "data_state": { "primitive": "Raw", "timing": "query_time" @@ -59151,7 +63319,7 @@ ] ] }, - "producer": 8, + "producer": 9, "role": "Input", "window": "NotApplicable" } @@ -59284,7 +63452,24 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 1, "materialization": "NotMaterialized", "output_schema": { @@ -59300,12 +63485,9 @@ }, { "dtype": { - "ExactAggregate": [ - "Rate", - "Rate" - ] + "Plain": "float64" }, - "name": "state", + "name": "value", "nullable": false, "table": null }, @@ -59335,33 +63517,18 @@ ] }, "output_state": { - "primitive": "SummaryState", + "primitive": "Raw", "timing": "query_time" }, "payload": { - "ASAP": { - "PaneChain": { + "NonASAP": { + "TimeRange": { "child": 0, - "family": { - "ExactAggregate": [ - "Rate", - "Rate" - ] - }, - "filter": null, - "grouping": "PerSubpopulationInstance", - "input": { - "item": null, - "weight": { - "Column": "SampleValue" - }, - "weight_domain": { - "kind": "unknown_or_signed" - } - }, - "pane_count": 6, - "pane_width_ms": 10000, - "reduction": "PerEntity" + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } } } } @@ -59423,10 +63590,26 @@ }, "payload": { "ASAP": { - "SummaryMerge": { - "children": [ - 1 - ] + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" } } } @@ -59637,9 +63820,135 @@ } }, { - "guarantee": null, + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, "id": 6, "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", "output_schema": { "closed": true, "fields": [ @@ -59655,13 +63964,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -59687,17 +63996,17 @@ "payload": { "ASAP": { "PaneChain": { - "child": 0, + "child": 6, "family": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -59733,7 +64042,7 @@ }, { "guarantee": null, - "id": 7, + "id": 8, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -59750,13 +64059,13 @@ "dtype": { "Sketch": [ { - "algorithm": "CountSketchWithHeap", + "algorithm": "CmsWithHeap", "category": "TopK", "params": { - "CountSketchWithHeap": { - "depth": 149, + "CmsWithHeap": { + "depth": 7, "heap_size": 100, - "width": 30000 + "width": 272 } } }, @@ -59783,7 +64092,7 @@ "ASAP": { "SummaryMerge": { "children": [ - 6 + 7 ] } } @@ -59791,7 +64100,7 @@ }, { "guarantee": null, - "id": 8, + "id": 9, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -59832,14 +64141,14 @@ "k": 10 } }, - "summary_input": 7 + "summary_input": 8 } } } }, { "guarantee": null, - "id": 9, + "id": 10, "materialization": "NotMaterialized", "output_schema": { "closed": true, @@ -59875,7 +64184,7 @@ "payload": { "NonASAP": { "Project": { - "child": 8, + "child": 9, "cols": [ { "alias": "job", @@ -59898,237 +64207,40340 @@ ], "roots": [ 5, - 9 + 10 ], "scalar_roots": [] }, - "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1", - "from_logical": "L27", - "id": "P27" - } - ], - "pruned": [] - }, - "stage3_plan_selection": { - "accepted": { - "P1": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P2": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P3": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P4": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P5": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P6": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P7": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P8": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ], - "P9": [ - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - }, - { - "accepted_metric": null, - "sketches": [], - "summary": "metric not set; accepted exact", - "target_metric": null - } - ] - }, - "costs": { - "P1": { - "per_node": { - "0": { - "cost": 2.32, - "detail": "scan 4000000 samples; x 0.1000/s", - "multiplier": 1 - }, - "1": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", - "multiplier": 1 - }, - "10": { - "cost": 1.4000000000000001, - "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", - "multiplier": 1 - }, - "11": { - "cost": 0.0001, - "detail": "limit to 1000 rows; x 0.1000/s", - "multiplier": 1 - }, - "12": { - "cost": 0.0001, - "detail": "operator: pass 1000 rows; x 0.1000/s", - "multiplier": 1 - }, - "2": { - "cost": 0.4, - "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", - "multiplier": 1 - }, - "3": { - "cost": 0.1, - "detail": "finalize 1000000 accumulators; x 0.1000/s", - "multiplier": 1 - }, - "4": { - "cost": 0.1, - "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", - "multiplier": 1 - }, - "5": { - "cost": 9.999999999999999e-6, - "detail": "finalize 100 accumulators; x 0.1000/s", - "multiplier": 1 - }, - "6": { - "cost": 2.32, - "detail": "scan 4000000 samples; x 0.1000/s", - "multiplier": 1 - }, - "7": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", - "multiplier": 1 - }, - "8": { - "cost": 0.4, - "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", - "multiplier": 1 - }, - "9": { - "cost": 0.1, - "detail": "finalize 1000000 accumulators; x 0.1000/s", - "multiplier": 1 - } - }, - "source": "analytical-cost-v2 (illustrative statistics)", - "total": 7.94021, - "unit": "cost_per_second" + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes", + "from_logical": "L15", + "id": "P15" }, - "P2": { - "per_node": { - "0": { - "cost": 4.64, - "detail": "scan 4000000 samples; x 0.2000/s", - "multiplier": 2 - }, - "1": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", - "multiplier": 1 - }, - "10": { - "cost": 0.0001, - "detail": "limit to 1000 rows; x 0.1000/s", - "multiplier": 1 - }, - "11": { + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes · ingestion time: CMS+heap ×6 panes", + "from_logical": "L15", + "id": "P15-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L16", + "id": "P16" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · CMS+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: CMS+heap ×6 panes", + "from_logical": "L16", + "id": "P16-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes", + "from_logical": "L17", + "id": "P17" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · ingestion time: CMS+heap ×6 panes", + "from_logical": "L17", + "id": "P17-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L17", + "id": "P17-m2" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes, CMS+heap ×6 panes", + "from_logical": "L17", + "id": "P17-m3" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L18", + "id": "P18" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: CMS+heap ×6 panes", + "from_logical": "L18", + "id": "P18-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L18", + "id": "P18-m2" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CmsWithHeap", + "category": "TopK", + "params": { + "CmsWithHeap": { + "depth": 7, + "heap_size": 100, + "width": 272 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CMS+heap · Rate acc for Q1 in 6 × 10s panes, CMS+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes, CMS+heap ×6 panes", + "from_logical": "L18", + "id": "P18-m3" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap", + "from_logical": "L19", + "id": "P19" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · shared Scan #1", + "from_logical": "L20", + "id": "P20" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 6 + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 7, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 8 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · shared Scan #1, TimeRange #2", + "from_logical": "L21", + "id": "P21" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes", + "from_logical": "L22", + "id": "P22" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L22", + "id": "P22-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1", + "from_logical": "L23", + "id": "P23" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 6, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 7, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L23", + "id": "P23-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes", + "from_logical": "L24", + "id": "P24" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes · ingestion time: CountSketch+heap ×6 panes", + "from_logical": "L24", + "id": "P24-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L25", + "id": "P25" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "TimeRange": { + "child": 0, + "kind": "range", + "range": { + "nanos": 0, + "secs": 60 + } + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 1, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: CountSketch+heap ×6 panes", + "from_logical": "L25", + "id": "P25-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes", + "from_logical": "L26", + "id": "P26" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · ingestion time: CountSketch+heap ×6 panes", + "from_logical": "L26", + "id": "P26-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes", + "from_logical": "L26", + "id": "P26-m2" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · ingestion time: Rate acc ×6 panes, CountSketch+heap ×6 panes", + "from_logical": "L26", + "id": "P26-m3" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1", + "from_logical": "L27", + "id": "P27" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: CountSketch+heap ×6 panes", + "from_logical": "L27", + "id": "P27-m1" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 7, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 10, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 9, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 6, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 6, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 7 + ] + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 8 + } + } + } + }, + { + "guarantee": null, + "id": 10, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 9, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 10 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes", + "from_logical": "L27", + "id": "P27-m2" + }, + { + "dag": { + "edges": [ + { + "consumer": 1, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 2, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 1, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 3, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 2, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 4, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 3, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 5, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 4, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 6, + "data_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "producer": 0, + "role": "Input", + "window": "RequiresAlignedPanePhaseOrExactBoundaryResidual" + }, + { + "consumer": 7, + "data_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 6, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 8, + "data_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 7, + "role": "Input", + "window": "NotApplicable" + }, + { + "consumer": 9, + "data_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "grouping": "NotApplicable", + "intermediate_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "producer": 8, + "role": "Input", + "window": "NotApplicable" + } + ], + "nodes": [ + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact over exact inputs" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 0, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "ingestion_time" + }, + "payload": { + "NonASAP": { + "Scan": { + "predicates": [], + "schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "source": { + "TimeSeries": { + "metric": "http_requests_total" + } + } + } + } + } + }, + { + "guarantee": null, + "id": 1, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": "PerEntity" + } + } + } + }, + { + "guarantee": null, + "id": 2, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Rate", + "Rate" + ] + }, + "name": "state", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 1 + ] + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 3, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "timestamp" + }, + "name": "ts", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "value", + "nullable": false, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "$promql_series_identity", + "nullable": false, + "table": null + } + ], + "time_index": 0, + "unique_keys": [ + [ + 3, + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 2 + } + } + } + }, + { + "guarantee": null, + "id": 4, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryAgg": { + "child": 3, + "family": { + "ExactAggregate": [ + "Sum", + "Sum" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": null, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "unknown_or_signed" + } + }, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": { + "provenance": [ + { + "kind": "exact", + "reason": "exact accumulator over exact input" + } + ], + "spec": { + "error": { + "op": "zero" + }, + "failure_probability": { + "op": "zero" + }, + "metric": "absolute", + "scope": "per_value" + } + }, + "id": 5, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "float64" + }, + "name": "sum", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "FinalizeExactAccumulator": { + "child": 4 + } + } + } + }, + { + "guarantee": null, + "id": 6, + "materialization": { + "MatAtIngestion": "Memory" + }, + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "ingestion_time" + }, + "payload": { + "ASAP": { + "PaneChain": { + "child": 0, + "family": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "filter": null, + "grouping": "PerSubpopulationInstance", + "input": { + "item": { + "Column": { + "Named": "$promql_series_identity" + } + }, + "weight": { + "Column": "SampleValue" + }, + "weight_domain": { + "kind": "samples_of_metric", + "metric": "http_requests_total" + } + }, + "pane_count": 6, + "pane_width_ms": 10000, + "reduction": { + "Reduce": [ + 2 + ] + } + } + } + } + }, + { + "guarantee": null, + "id": 7, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Sketch": [ + { + "algorithm": "CountSketchWithHeap", + "category": "TopK", + "params": { + "CountSketchWithHeap": { + "depth": 149, + "heap_size": 100, + "width": 30000 + } + } + }, + "PerSubpopulationInstance" + ] + }, + "name": "state", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "SummaryState", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryMerge": { + "children": [ + 6 + ] + } + } + } + }, + { + "guarantee": null, + "id": 8, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "ASAP": { + "SummaryEstimate": { + "query": { + "TopK": { + "k": 10 + } + }, + "summary_input": 7 + } + } + } + }, + { + "guarantee": null, + "id": 9, + "materialization": "NotMaterialized", + "output_schema": { + "closed": true, + "fields": [ + { + "dtype": { + "Plain": "utf8" + }, + "name": "job", + "nullable": true, + "table": null + }, + { + "dtype": { + "Plain": "utf8" + }, + "name": "topk_10", + "nullable": false, + "table": null + } + ], + "time_index": null, + "unique_keys": [ + [ + 0 + ] + ] + }, + "output_state": { + "primitive": "Raw", + "timing": "query_time" + }, + "payload": { + "NonASAP": { + "Project": { + "child": 8, + "cols": [ + { + "alias": "job", + "expr": { + "Column": 0 + } + }, + { + "alias": "topk_10", + "expr": { + "Column": 1 + } + } + ], + "qualifier": null + } + } + } + } + ], + "roots": [ + 5, + 9 + ], + "scalar_roots": [] + }, + "display_name": "Q1 exact (Sum acc, Rate acc) · Q2 CountSketch+heap · Rate acc for Q1 in 6 × 10s panes, CountSketch+heap for Q2 in 6 × 10s panes · shared Scan #1 · ingestion time: Rate acc ×6 panes, CountSketch+heap ×6 panes", + "from_logical": "L27", + "id": "P27-m3" + } + ], + "pruned": [] + }, + "stage3_plan_selection": { + "accepted": { + "P1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P2": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P3": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P4": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P4-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P5": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P5-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P6": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P6-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P7": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P7-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P8": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P8-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P8-m2": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P8-m3": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P9": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P9-m1": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P9-m2": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ], + "P9-m3": [ + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + }, + { + "accepted_metric": null, + "sketches": [], + "summary": "metric not set; accepted exact", + "target_metric": null + } + ] + }, + "costs": { + "P1": { + "per_node": { + "0": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 7.94021, + "unit": "cost_per_second" + }, + "P2": { + "per_node": { + "0": { + "cost": 4.64, + "detail": "scan 4000000 samples; x 0.2000/s", + "multiplier": 2 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 7.9402099999999995, + "unit": "cost_per_second" + }, + "P3": { + "per_node": { + "0": { + "cost": 4.64, + "detail": "scan 4000000 samples; x 0.2000/s", + "multiplier": 2 + }, + "1": { + "cost": 0.8, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.2000/s", + "multiplier": 2 + }, + "10": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 7.940209999999999, + "unit": "cost_per_second" + }, + "P4": { + "per_node": { + "0": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "1": { + "cost": 0.8, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 8.54021, + "unit": "cost_per_second" + }, + "P4-m1": { + "per_node": { + "0": { + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 + }, + "1": { + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 12.940212599999999, + "unit": "cost_per_second" + }, + "P5": { + "per_node": { + "0": { + "cost": 4.64, + "detail": "scan 4000000 samples; x 0.2000/s", + "multiplier": 2 + }, + "1": { + "cost": 0.8, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 8.540209999999998, + "unit": "cost_per_second" + }, + "P5-m1": { + "per_node": { + "0": { + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 + }, + "1": { + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.4, + "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 12.940212599999999, + "unit": "cost_per_second" + }, + "P6": { + "per_node": { + "0": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.8, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 8.54021, + "unit": "cost_per_second" + }, + "P6-m1": { + "per_node": { + "0": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 + }, + "7": { + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", + "multiplier": 1 + }, + "8": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 12.940212599999999, + "unit": "cost_per_second" + }, + "P7": { + "per_node": { + "0": { + "cost": 4.64, + "detail": "scan 4000000 samples; x 0.2000/s", + "multiplier": 2 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.4, + "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "6": { + "cost": 0.8, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "multiplier": 1 + }, + "7": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "8": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 8.540209999999998, + "unit": "cost_per_second" + }, + "P7-m1": { + "per_node": { + "0": { + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 + }, + "1": { + "cost": 0.4, + "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { "cost": 0.0001, "detail": "operator: pass 1000 rows; x 0.1000/s", "multiplier": 1 @@ -60154,50 +104566,60 @@ "multiplier": 1 }, "6": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", "multiplier": 1 }, "7": { - "cost": 0.4, - "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "8": { - "cost": 0.1, - "detail": "finalize 1000000 accumulators; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "9": { - "cost": 1.4000000000000001, - "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", "multiplier": 1 } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 7.9402099999999995, + "total": 12.940212599999999, "unit": "cost_per_second" }, - "P3": { + "P8": { "per_node": { "0": { - "cost": 4.64, - "detail": "scan 4000000 samples; x 0.2000/s", - "multiplier": 2 + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", + "multiplier": 1 }, "1": { "cost": 0.8, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.2000/s", - "multiplier": 2 + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "multiplier": 1 }, "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { "cost": 0.0001, "detail": "operator: pass 1000 rows; x 0.1000/s", "multiplier": 1 }, "2": { - "cost": 0.4, - "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "3": { @@ -60216,31 +104638,31 @@ "multiplier": 1 }, "6": { - "cost": 0.4, - "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", "multiplier": 1 }, "7": { - "cost": 0.1, - "detail": "finalize 1000000 accumulators; x 0.1000/s", + "cost": 0.8, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", "multiplier": 1 }, "8": { - "cost": 1.4000000000000001, - "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "9": { - "cost": 0.0001, - "detail": "limit to 1000 rows; x 0.1000/s", + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", "multiplier": 1 } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 7.940209999999999, + "total": 9.14021, "unit": "cost_per_second" }, - "P4": { + "P8-m1": { "per_node": { "0": { "cost": 2.32, @@ -60288,18 +104710,18 @@ "multiplier": 1 }, "6": { - "cost": 2.32, - "detail": "scan 4000000 samples; x 0.1000/s", + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", "multiplier": 1 }, "7": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "8": { - "cost": 0.4, - "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "9": { @@ -60309,27 +104731,32 @@ } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 8.54021, + "total": 13.540212599999998, "unit": "cost_per_second" }, - "P5": { + "P8-m2": { "per_node": { "0": { - "cost": 4.64, - "detail": "scan 4000000 samples; x 0.2000/s", - "multiplier": 2 + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 }, "1": { - "cost": 0.8, - "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { "cost": 0.0001, "detail": "limit to 1000 rows; x 0.1000/s", "multiplier": 1 }, - "11": { + "12": { "cost": 0.0001, "detail": "operator: pass 1000 rows; x 0.1000/s", "multiplier": 1 @@ -60355,40 +104782,40 @@ "multiplier": 1 }, "6": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "cost": 2.32, + "detail": "scan 4000000 samples; x 0.1000/s", "multiplier": 1 }, "7": { - "cost": 0.4, - "detail": "build exact Sum accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 0.8, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", "multiplier": 1 }, "8": { - "cost": 0.1, - "detail": "finalize 1000000 accumulators; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "9": { - "cost": 1.4000000000000001, - "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", "multiplier": 1 } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 8.540209999999998, + "total": 13.540212599999998, "unit": "cost_per_second" }, - "P6": { + "P8-m3": { "per_node": { "0": { - "cost": 2.32, - "detail": "scan 4000000 samples; x 0.1000/s", + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", "multiplier": 1 }, "1": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "10": { @@ -60407,8 +104834,8 @@ "multiplier": 1 }, "2": { - "cost": 0.4, - "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "3": { @@ -60427,13 +104854,13 @@ "multiplier": 1 }, "6": { - "cost": 2.32, - "detail": "scan 4000000 samples; x 0.1000/s", + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", "multiplier": 1 }, "7": { - "cost": 0.8, - "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "8": { @@ -60448,10 +104875,10 @@ } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 8.54021, + "total": 17.940215199999997, "unit": "cost_per_second" }, - "P7": { + "P9": { "per_node": { "0": { "cost": 4.64, @@ -60459,8 +104886,8 @@ "multiplier": 2 }, "1": { - "cost": 0.4, - "detail": "time range 60s: keep 4000000 of 4000000 rows; x 0.1000/s", + "cost": 0.8, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", "multiplier": 1 }, "10": { @@ -60474,8 +104901,8 @@ "multiplier": 1 }, "2": { - "cost": 0.4, - "detail": "build exact Rate accumulator into 1000000 states: 4000000 rows x depth 1; x 0.1000/s", + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", "multiplier": 1 }, "3": { @@ -60515,10 +104942,10 @@ } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 8.540209999999998, + "total": 9.140209999999998, "unit": "cost_per_second" }, - "P8": { + "P9-m1": { "per_node": { "0": { "cost": 2.32, @@ -60565,6 +104992,78 @@ "detail": "finalize 100 accumulators; x 0.1000/s", "multiplier": 1 }, + "6": { + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 + }, + "7": { + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", + "multiplier": 1 + }, + "8": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "9": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + } + }, + "source": "analytical-cost-v2 (illustrative statistics)", + "total": 13.540212599999998, + "unit": "cost_per_second" + }, + "P9-m2": { + "per_node": { + "0": { + "cost": 0.3866686, + "detail": "scan 66667 samples; x 1.0000/s", + "multiplier": 1 + }, + "1": { + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", + "multiplier": 1 + }, + "10": { + "cost": 1.4000000000000001, + "detail": "sort 1000000 rows in 100 partitions; x 0.1000/s", + "multiplier": 1 + }, + "11": { + "cost": 0.0001, + "detail": "limit to 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "12": { + "cost": 0.0001, + "detail": "operator: pass 1000 rows; x 0.1000/s", + "multiplier": 1 + }, + "2": { + "cost": 0.6000000000000001, + "detail": "merge 6000000 states into 1000000; x 0.1000/s", + "multiplier": 1 + }, + "3": { + "cost": 0.1, + "detail": "finalize 1000000 accumulators; x 0.1000/s", + "multiplier": 1 + }, + "4": { + "cost": 0.1, + "detail": "build exact Sum accumulator into 100 states: 1000000 rows x depth 1; x 0.1000/s", + "multiplier": 1 + }, + "5": { + "cost": 9.999999999999999e-6, + "detail": "finalize 100 accumulators; x 0.1000/s", + "multiplier": 1 + }, "6": { "cost": 2.32, "detail": "scan 4000000 samples; x 0.1000/s", @@ -60587,19 +105086,19 @@ } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 9.14021, + "total": 13.540212599999998, "unit": "cost_per_second" }, - "P9": { + "P9-m3": { "per_node": { "0": { - "cost": 4.64, - "detail": "scan 4000000 samples; x 0.2000/s", + "cost": 0.7733372, + "detail": "scan 66667 samples; x 2.0000/s", "multiplier": 2 }, "1": { - "cost": 0.8, - "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Rate accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "10": { @@ -60633,8 +105132,8 @@ "multiplier": 1 }, "6": { - "cost": 0.8, - "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 4000000 rows x (1 + depth 1); x 0.1000/s", + "cost": 7.133334, + "detail": "build exact Sum accumulator in 6 panes of 10000 ms for 1000000 groups: 66667 rows x (1 + depth 1); x 1.0000/s; keeps 56000000 bytes", "multiplier": 1 }, "7": { @@ -60654,7 +105153,7 @@ } }, "source": "analytical-cost-v2 (illustrative statistics)", - "total": 9.140209999999998, + "total": 17.940215199999997, "unit": "cost_per_second" } }, @@ -60679,31 +105178,81 @@ "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P13-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P14", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P14-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P15", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P15-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P16", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P16-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P17", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P17-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P17-m2", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P17-m3", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P18", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P18-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P18-m2", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P18-m3", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P19", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", @@ -60724,31 +105273,81 @@ "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P22-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P23", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P23-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P24", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P24-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P25", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P25-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P26", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P26-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P26-m2", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P26-m3", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P27", "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", "valid": false }, + { + "id": "P27-m1", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P27-m2", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, + { + "id": "P27-m3", + "reason": "q2: the output has no guarantee, and the deployment has no evidence that it meets target AccuracyTarget { metric: None, error: 0.01, failure_probability: Some(0.001), scope: WholeResult }", + "valid": false + }, { "id": "P2", "reason": "tied with the selected candidate P1 at 7.940 cost_per_second; lost on enumeration order", @@ -60764,30 +105363,80 @@ "reason": "costlier: 8.540 vs 7.940 cost_per_second", "valid": true }, + { + "id": "P4-m1", + "reason": "costlier: 12.940 vs 7.940 cost_per_second", + "valid": true + }, { "id": "P5", "reason": "costlier: 8.540 vs 7.940 cost_per_second", "valid": true }, + { + "id": "P5-m1", + "reason": "costlier: 12.940 vs 7.940 cost_per_second", + "valid": true + }, { "id": "P6", "reason": "costlier: 8.540 vs 7.940 cost_per_second", "valid": true }, + { + "id": "P6-m1", + "reason": "costlier: 12.940 vs 7.940 cost_per_second", + "valid": true + }, { "id": "P7", "reason": "costlier: 8.540 vs 7.940 cost_per_second", "valid": true }, + { + "id": "P7-m1", + "reason": "costlier: 12.940 vs 7.940 cost_per_second", + "valid": true + }, { "id": "P8", "reason": "costlier: 9.140 vs 7.940 cost_per_second", "valid": true }, + { + "id": "P8-m1", + "reason": "costlier: 13.540 vs 7.940 cost_per_second", + "valid": true + }, + { + "id": "P8-m2", + "reason": "costlier: 13.540 vs 7.940 cost_per_second", + "valid": true + }, + { + "id": "P8-m3", + "reason": "costlier: 17.940 vs 7.940 cost_per_second", + "valid": true + }, { "id": "P9", "reason": "costlier: 9.140 vs 7.940 cost_per_second", "valid": true + }, + { + "id": "P9-m1", + "reason": "costlier: 13.540 vs 7.940 cost_per_second", + "valid": true + }, + { + "id": "P9-m2", + "reason": "costlier: 13.540 vs 7.940 cost_per_second", + "valid": true + }, + { + "id": "P9-m3", + "reason": "costlier: 17.940 vs 7.940 cost_per_second", + "valid": true } ], "selected": "P1" From 9bedcb05b9c3348be3b1468920d5ea6d6547844c Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:31:49 +0000 Subject: [PATCH 2/8] refactor(planner): rename MaterializationUnit to MaterializationCandidate One summary build Stage 2 may store, with its options; not a whole-workload plan like PhysicalCandidate. Related identifiers follow (materialization_candidates, candidates_below, mat_candidates). --- .../src/stage2_physical_asap_optimization.rs | 140 ++++++++++-------- 1 file changed, 77 insertions(+), 63 deletions(-) diff --git a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs index b6ae276b0..5717e57a5 100644 --- a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs +++ b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs @@ -4,25 +4,26 @@ //! //! ## Materialization //! -//! Each summary build (a `SummaryAgg` or a `PaneChain`) is one unit whose +//! Each summary build (a `SummaryAgg` or a `PaneChain`) is one +//! materialization candidate ([`MaterializationCandidate`]) whose //! output materialization may store (#509 §Materialization, Algorithm 3). -//! Each unit has up to three options: +//! Each has up to three options: //! //! * `NotMaterialized`: rebuilt at query time by every query that reads it; //! * `MatAtIngestion(Memory)`: maintained as data arrives and kept for the -//! queries, when the unit is eligible ([`IngestionPruneReason`]); +//! queries, when the build is eligible ([`IngestionPruneReason`]); //! * `MatAtQuery(Memory)`: built once per evaluation for every query that -//! reads it, offered for a unit two or more queries read. State is reused +//! reads it, offered for a build two or more queries read. State is reused //! only within one evaluation; keeping it across evaluations comes later. //! -//! A unit at ingestion time needs every unit below it at ingestion time too +//! A build at ingestion time needs every build below it at ingestion time too //! (#509 Algorithm 3, line 13); such assignments are not generated. Every //! other combination of options is one physical candidate, the //! all-`NotMaterialized` one first: nothing is capped. A node that one //! query reads at ingestion time and another at query time is copied, one //! copy per phase ([`split_shared_by_phase`]). //! -//! A unit may run at ingestion time (S4) only when: +//! A build may run at ingestion time (S4) only when: //! //! * the data workload is continuously ingesting or mixed (unknown arrival //! counts as not ingesting); @@ -122,7 +123,7 @@ pub enum PhysicalASAPOptimizationError { } /// Why a summary build cannot be materialized at ingestion time (S4). -/// Stage 2 bookkeeping, like [`MaterializationUnit`]. +/// Stage 2 bookkeeping, like [`MaterializationCandidate`]. #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) enum IngestionPruneReason { /// The data workload is at rest, or its arrival is unknown. @@ -145,8 +146,11 @@ pub(crate) enum IngestionPruneReason { UpstreamAtQueryTime(String), } -/// Stage 2's enumeration bookkeeping: one summary build Stage 2 may decide -/// to store, with the options it has. For example, over one metric: +/// One summary build Stage 2 may store, with its materialization options. +/// It is not a whole-workload plan like [`PhysicalCandidate`]: it is Stage +/// 2's enumeration bookkeeping, and the physical candidates are the +/// combinations of the materialization candidates' options. For example, +/// over one metric: /// /// ```text /// q1: quantile_over_time(0.99, latency[5m]) every 1m @@ -154,22 +158,22 @@ pub(crate) enum IngestionPruneReason { /// ``` /// /// If Stage 1 chose KLL panes for q1 and exact max panes for q2, Stage 2 -/// finds two units: +/// finds two materialization candidates: /// -/// | unit | readers | options | -/// |-------------------|---------|----------------------------------| -/// | Kll ×5 panes (q1) | q1 | NotMaterialized, MatAtIngestion | -/// | Max acc ×5 panes | q2 | NotMaterialized, MatAtIngestion | +/// | materialization candidate | readers | options | +/// |---------------------------|---------|---------------------------------| +/// | Kll ×5 panes (q1) | q1 | NotMaterialized, MatAtIngestion | +/// | Max acc ×5 panes (q2) | q2 | NotMaterialized, MatAtIngestion | /// -/// A unit read by two or more queries also gets `MatAtQuery` (built once -/// per evaluation and reused). The physical candidates are the product of -/// the units' options, here 2 × 2 = 4, less the assignments that put a -/// unit at ingestion time over one that is not; Stage 3 prices each. +/// One read by two or more queries also gets `MatAtQuery` (built once per +/// evaluation and reused). The physical candidates are the product of the +/// options, here 2 × 2 = 4, less the assignments that put a build at +/// ingestion time over one that is not; Stage 3 prices each. /// `at_ingestion` records why ingestion is ruled out when it is (e.g. -/// `Filtered`, `NotRepeated`). The result each candidate carries is its -/// assignment ([`PhysicalCandidate::materialization`]). +/// `Filtered`, `NotRepeated`). Each physical candidate carries the +/// resulting assignment ([`PhysicalCandidate::materialization`]). #[derive(Debug, Clone)] -pub(crate) struct MaterializationUnit { +pub(crate) struct MaterializationCandidate { /// The build in the implemented DAG. pub(crate) node: Rc, /// The queries (indices into the roots) that read it. @@ -178,7 +182,7 @@ pub(crate) struct MaterializationUnit { pub(crate) at_ingestion: Result<(), IngestionPruneReason>, } -impl MaterializationUnit { +impl MaterializationCandidate { /// Its options, `NotMaterialized` first: `MatAtIngestion` when eligible, /// `MatAtQuery` when two or more queries read it. pub(crate) fn options(&self) -> Vec { @@ -195,7 +199,7 @@ impl MaterializationUnit { /// Stage 2 for one CandidateLogicalASAPDAG: implement every operator /// (physical operator implementation), then one physical candidate per -/// materialization assignment of its units, the all-`NotMaterialized` one +/// materialization assignment of its mat_candidates, the all-`NotMaterialized` one /// first. `demand[i]` is how query `i` (`roots[i]`) is demanded; a missing /// entry is unknown. `id` is left empty for the caller to name. Sharing between `roots` is preserved: one memo serves the whole /// workload. @@ -207,18 +211,18 @@ pub fn optimize_physical_asap( ) -> Result, PhysicalASAPOptimizationError> { let mut memo = HashMap::new(); let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; - let units = materialization_units(&implemented, demand, data); + let mat_candidates = materialization_candidates(&implemented, demand, data); let mut candidates = Vec::new(); - for assignment in materialization_assignments(&units) { - let materialized: Vec<_> = units + for assignment in materialization_assignments(&mat_candidates) { + let materialized: Vec<_> = mat_candidates .iter() .zip(&assignment) .filter(|(_, m)| **m != Materialization::NotMaterialized) - .map(|(unit, m)| (unit, *m)) + .map(|(mat_candidate, m)| (mat_candidate, *m)) .collect(); let mut options = MaterializationAssignment::with_default(Materialization::NotMaterialized); - for (unit, materialization) in &materialized { - options.set(&unit.node, *materialization); + for (mat_candidate, materialization) in &materialized { + options.set(&mat_candidate.node, *materialization); } let operators: Vec> = implemented .iter() @@ -270,7 +274,10 @@ pub fn physical_candidate_count( ) -> Result { let mut memo = HashMap::new(); let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; - Ok(materialization_assignments(&materialization_units(&implemented, demand, data)).count()) + Ok( + materialization_assignments(&materialization_candidates(&implemented, demand, data)) + .count(), + ) } /// The operator nodes `root` reads. @@ -283,11 +290,11 @@ fn root_operators(root: &QueryRoot) -> Vec<&Rc> { /// Every summary build of `roots` (implemented), in discovery order, with /// its readers and whether it may run at ingestion time. -pub(crate) fn materialization_units( +pub(crate) fn materialization_candidates( roots: &[QueryRoot], demand: &[QueryDemand], data: &DataWorkload, -) -> Vec { +) -> Vec { let mut nodes: Vec> = Vec::new(); let mut readers: HashMap<*const OperatorNode, Vec> = HashMap::new(); for (query, root) in roots.iter().enumerate() { @@ -309,24 +316,24 @@ pub(crate) fn materialization_units( } } } - let below = units_below(&nodes); + let below = candidates_below(&nodes); nodes .iter() .enumerate() - .map(|(u, node)| { + .map(|(c, node)| { let readers = readers[&Rc::as_ptr(node)].clone(); let at_ingestion = ingestion_eligibility(node, &readers, demand, data).and_then(|()| { - // Only this unit and the units below it at ingestion time. + // Only this build and the builds below it at ingestion time. let mut trial = MaterializationAssignment::with_default(Materialization::NotMaterialized); - for &v in below[u].iter().chain([&u]) { + for &v in below[c].iter().chain([&c]) { trial.set(&nodes[v], Materialization::MatAtIngestion(Medium::Memory)); } apply_materialization_timings(node, &trial, &mut TimingMemo::new()) .map(|_| ()) .map_err(|e| IngestionPruneReason::UpstreamAtQueryTime(e.to_string())) }); - MaterializationUnit { + MaterializationCandidate { node: Rc::clone(node), readers, at_ingestion, @@ -376,7 +383,7 @@ fn ingestion_eligibility( let (family, chain) = match node.asap() { Some(ASAPOp::SummaryAgg { family, .. }) => (family, false), Some(ASAPOp::PaneChain { family, .. }) => (family, true), - _ => unreachable!("a unit is a summary build"), + _ => unreachable!("a materialization candidate is a summary build"), }; if matches!( family, @@ -427,7 +434,7 @@ fn ingestion_eligibility( } /// For each of `nodes`, the indices of the others below it. -fn units_below(nodes: &[Rc]) -> Vec> { +fn candidates_below(nodes: &[Rc]) -> Vec> { nodes .iter() .map(|node| { @@ -442,16 +449,16 @@ fn units_below(nodes: &[Rc]) -> Vec> { .collect() } -/// Every assignment of an option to each unit (mixed radix, the last unit -/// varying fastest, all `NotMaterialized` first) in which every unit below -/// an ingestion-time unit is at ingestion time too. +/// Every assignment of an option to each materialization candidate (mixed +/// radix, the last varying fastest, all `NotMaterialized` first) in which +/// every build below an ingestion-time build is at ingestion time too. fn materialization_assignments( - units: &[MaterializationUnit], + mat_candidates: &[MaterializationCandidate], ) -> impl Iterator> + '_ { - let options: Vec> = units.iter().map(|u| u.options()).collect(); - let nodes: Vec<_> = units.iter().map(|u| Rc::clone(&u.node)).collect(); - let below = units_below(&nodes); - let mut digits = Some(vec![0usize; units.len()]); + let options: Vec> = mat_candidates.iter().map(|c| c.options()).collect(); + let nodes: Vec<_> = mat_candidates.iter().map(|c| Rc::clone(&c.node)).collect(); + let below = candidates_below(&nodes); + let mut digits = Some(vec![0usize; mat_candidates.len()]); std::iter::from_fn(move || loop { let current = digits.as_mut()?; let assignment: Vec = current @@ -473,8 +480,8 @@ fn materialization_assignments( digits = None; } let at_ingestion = |m: &Materialization| m.timing() == ExecutionTiming::IngestionTime; - let down_closed = assignment.iter().enumerate().all(|(u, m)| { - !at_ingestion(m) || below[u].iter().all(|&v| at_ingestion(&assignment[v])) + let down_closed = assignment.iter().enumerate().all(|(c, m)| { + !at_ingestion(m) || below[c].iter().all(|&v| at_ingestion(&assignment[v])) }); if down_closed { return Some(assignment); @@ -1028,7 +1035,7 @@ mod tests { /// S4: maintaining state at ingestion time needs arriving data and /// queries that repeat and are predictable; otherwise the chain only - /// runs at query time, and the unit says why. + /// runs at query time, and the materialization candidate says why. #[test] fn ingestion_time_needs_arriving_data_and_repeated_predictable_queries() { use IngestionPruneReason as Why; @@ -1060,9 +1067,9 @@ mod tests { assert_eq!(candidates.len(), 1, "{why:?}"); let mut memo = HashMap::new(); let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); - let units = materialization_units(&implemented, &[demand], &data); - assert_eq!(units.len(), 1); - assert_eq!(units[0].at_ingestion, Err(why)); + let mat_candidates = materialization_candidates(&implemented, &[demand], &data); + assert_eq!(mat_candidates.len(), 1); + assert_eq!(mat_candidates[0].at_ingestion, Err(why)); } } @@ -1076,8 +1083,9 @@ mod tests { let roots = [in_panes(summary_root(query))]; let mut memo = HashMap::new(); let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); - let units = materialization_units(&implemented, &[every_minute()], &arriving()); - assert_eq!(units[0].at_ingestion, Ok(()), "{query}"); + let mat_candidates = + materialization_candidates(&implemented, &[every_minute()], &arriving()); + assert_eq!(mat_candidates[0].at_ingestion, Ok(()), "{query}"); let candidates = optimize_physical_asap("L1", &roots, &[every_minute()], &arriving()).unwrap(); assert_eq!(candidates.len(), 2, "{query}"); @@ -1103,8 +1111,11 @@ mod tests { let roots = [root]; let mut memo = HashMap::new(); let implemented = map_roots(&roots, &mut |n| implement(n, &mut memo)).unwrap(); - let units = materialization_units(&implemented, &[every_minute()], &data); - assert_eq!(units[0].at_ingestion, Err(Why::CounterNeedsTimeOrder)); + let mat_candidates = materialization_candidates(&implemented, &[every_minute()], &data); + assert_eq!( + mat_candidates[0].at_ingestion, + Err(Why::CounterNeedsTimeOrder) + ); } } @@ -1137,17 +1148,20 @@ mod tests { }), ..every_minute() }; - let units = |root: &QueryRoot, demand: QueryDemand| { + let mat_candidates = |root: &QueryRoot, demand: QueryDemand| { let mut memo = HashMap::new(); let implemented = map_roots(std::slice::from_ref(root), &mut |n| implement(n, &mut memo)).unwrap(); - materialization_units(&implemented, &[demand], &arriving()) + materialization_candidates(&implemented, &[demand], &arriving()) .remove(0) .at_ingestion }; - assert_eq!(units(&root, at(MINUTE as u32)), Ok(())); - assert_eq!(units(&root, every_minute()), Err(Why::WindowNotFixed)); - assert_eq!(units(&root, at(30_000)), Err(Why::WindowNotFixed)); + assert_eq!(mat_candidates(&root, at(MINUTE as u32)), Ok(())); + assert_eq!( + mat_candidates(&root, every_minute()), + Err(Why::WindowNotFixed) + ); + assert_eq!(mat_candidates(&root, at(30_000)), Err(Why::WindowNotFixed)); let candidates = optimize_physical_asap( "L1", std::slice::from_ref(&root), @@ -1193,7 +1207,7 @@ mod tests { .with_guarantee(build.guarantee.clone()), ); assert_eq!( - units(&QueryRoot::Operator(filtered), at(MINUTE as u32)), + mat_candidates(&QueryRoot::Operator(filtered), at(MINUTE as u32)), Err(Why::Filtered) ); } From 6d408c30bccffc71f98df465c32781f44eb1f3bd Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:40:05 +0000 Subject: [PATCH 3/8] test(types): query requirements are a target and an optional latency bound (failing) --- crates/types/src/workload.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/types/src/workload.rs b/crates/types/src/workload.rs index acceeacab..d196368d1 100644 --- a/crates/types/src/workload.rs +++ b/crates/types/src/workload.rs @@ -821,6 +821,35 @@ pub enum WorkloadError { mod tests { use super::*; + /// Query requirements: an accuracy target (omitted: exact) and an + /// optional latency bound in ms (omitted: none). The old tagged forms + /// and unknown fields are rejected. + #[test] + fn query_requirements_json_is_a_target_and_an_optional_bound() { + let parse = |json: &str| serde_json::from_str::(json); + let empty = serde_json::to_value(parse("{}").unwrap()).unwrap(); + assert_eq!( + empty, + serde_json::json!({"accuracy": {"error": 0.0, "failure_probability": 0.0, + "scope": "whole_result"}, "max_latency_ms": null}) + ); + let bounded = serde_json::to_value( + parse(r#"{"accuracy": {"error": 0.01}, "max_latency_ms": 200.0}"#).unwrap(), + ) + .unwrap(); + assert_eq!(bounded["accuracy"]["error"], 0.01); + assert_eq!(bounded["max_latency_ms"], 200.0); + for old in [ + r#"{"accuracy": "implicit_exact", "response_latency": "unspecified"}"#, + r#"{"accuracy": {"explicit": {"error": 0.01}}}"#, + r#"{"response_latency": {"explicit_max_ms": 100.0}}"#, + r#"{"max_latency_ms": 100.0, "unknown": 1}"#, + ] { + assert!(parse(old).is_err(), "{old}"); + } + } + + /// A stream norm is a finite, non-negative magnitude. #[test] fn stream_norms_must_be_finite_and_non_negative() { From 9d27383712e9324f704410595d08ee72cdf989fb Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:46:34 +0000 Subject: [PATCH 4/8] refactor(types)!: QueryRequirements is an accuracy target and an optional latency bound QueryRequirements { accuracy: AccuracyTarget, max_latency_ms: Option } replaces AccuracyRequirement { Explicit, ImplicitExact } and LatencyRequirement { ExplicitMaxMs, Unspecified }. JSON: an omitted accuracy is AccuracyTarget::exact(), an omitted max_latency_ms imposes no bound, unknown fields are rejected, and the old tagged forms are not accepted. The viewer document's query requirements use max_latency_ms. --- .../src/pass/stage1_to_stage3.rs | 2 +- .../src/query_physical_lowering.rs | 6 +- .../src/stage2_physical_asap_optimization.rs | 4 +- .../src/stage3_plan_selection.rs | 26 ++++---- crates/asap-aware-mapping/src/test_support.rs | 6 +- .../tests/per_computation_candidates.rs | 17 +++-- .../src/physical_planner/candidates.rs | 4 +- .../tests/current_series_heap.rs | 2 +- .../tests/deployment_computation.rs | 2 +- .../tests/planspace_series_identity_heap.rs | 7 +- .../tests/precompute_candidates.rs | 4 +- .../tests/weighted_topk_binding.rs | 7 +- crates/devtools/src/bin/stage_pipeline.rs | 13 ++-- crates/devtools/src/lib.rs | 2 +- .../devtools/src/planner_layering_examples.rs | 41 +++++------- crates/devtools/src/planning_stages.rs | 4 +- crates/frontend-metricsql/src/lib.rs | 2 +- crates/frontend-promql/src/lib.rs | 2 +- .../frontend-promql/tests/promql_lowering.rs | 6 +- crates/frontend-promql/tests/support.rs | 6 +- crates/frontend-sql/src/lib.rs | 2 +- crates/frontend-sql/tests/frequency_l2.rs | 8 +-- crates/integration-tests/src/lib.rs | 6 +- .../tests/operator_design_examples.rs | 2 +- .../tests/planner_layering_example2.rs | 21 +++--- .../tests/stage1_logical_asap_optimization.rs | 6 +- crates/planner/src/lib.rs | 2 +- crates/planner/tests/e2e_plan.rs | 16 ++--- crates/planner/tests/plan_stages.rs | 6 +- crates/planner/tests/summary_sharing.rs | 10 +-- crates/types/src/workload.rs | 64 ++++++------------- .../architecture/input-output-workflow.md | 4 +- docs/develop_docs/library-api.md | 18 +++--- tools/dag-viewer/app.js | 2 +- .../examples/planner-layering-example1.json | 2 +- 35 files changed, 145 insertions(+), 187 deletions(-) diff --git a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs index 6fec9309a..47a07a1cd 100644 --- a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs +++ b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs @@ -774,7 +774,7 @@ impl OptimizationPass for Stage1ToStage3Pass { let targets: Vec<_> = workload .query_workload() .entries() - .map(|entry| Some(entry.requirements.accuracy.requested())) + .map(|entry| Some(entry.requirements.accuracy.clone())) .collect(); let demand: Vec<_> = workload .query_workload() diff --git a/crates/asap-aware-mapping/src/query_physical_lowering.rs b/crates/asap-aware-mapping/src/query_physical_lowering.rs index ade618fab..7a3f65a28 100644 --- a/crates/asap-aware-mapping/src/query_physical_lowering.rs +++ b/crates/asap-aware-mapping/src/query_physical_lowering.rs @@ -2874,8 +2874,8 @@ mod tests { ) { use crate::physical_operator_statistics::ScalarInputStatistics; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, Evidence, PlanningWorkload, - Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, + BatchEntry, DataWorkload, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, }; use std::cell::RefCell; @@ -2885,7 +2885,7 @@ mod tests { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::exact()), + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs index 5717e57a5..a79790bb9 100644 --- a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs +++ b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs @@ -915,7 +915,7 @@ mod tests { // ── Materialization ────────────────────────────────────────────────── - use asap_types::workload::{DataArrival, LatencyRequirement, RepetitionInterval, TimestampMs}; + use asap_types::workload::{DataArrival, RepetitionInterval, TimestampMs}; const MINUTE: u64 = 60_000; @@ -970,7 +970,7 @@ mod tests { RepetitionInterval(MINUTE as u32), )), predictability: Predictability::Predictable { known_at: None }, - response_latency: LatencyRequirement::Unspecified, + max_latency_ms: None, } } diff --git a/crates/asap-aware-mapping/src/stage3_plan_selection.rs b/crates/asap-aware-mapping/src/stage3_plan_selection.rs index 45c6a0ee7..118c4969b 100644 --- a/crates/asap-aware-mapping/src/stage3_plan_selection.rs +++ b/crates/asap-aware-mapping/src/stage3_plan_selection.rs @@ -93,7 +93,7 @@ //! `k` partial copies of its newest window, and compacting them takes //! `(k − 1)` one-operation merges for each of its states per window; with //! one core there is nothing to compact. A query with -//! `LatencyRequirement::ExplicitMaxMs(bound)` whose latency is above the +//! `Some(bound)` whose latency is above the //! bound makes the candidate invalid, with the latency as the reason. //! [`CandidateCost::latency`] reports every query's latency. use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; @@ -117,7 +117,7 @@ use asap_types::post_asap::{ use asap_types::pre_asap::{AggIntent, DataType, Reduction, ScalarValue, Schema}; use asap_types::types::{AccuracyScope, AccuracyTarget}; use asap_types::workload::{ - DataWorkload, LatencyRequirement, MetricType, QueryDemand, QueryRecurrence, RepeatedDemand, + DataWorkload, MetricType, QueryDemand, QueryRecurrence, RepeatedDemand, }; use thiserror::Error; @@ -216,17 +216,15 @@ fn latency_violation(cost: &CandidateCost, demand: &[QueryDemand]) -> Option bound => { - Some(format!( - "q{}: latency {:.1} ms per evaluation (compaction {:.1} ms + query {:.1} ms) \ + .find_map(|(query, (latency, demand))| match demand.max_latency_ms { + Some(bound) if latency.total_ms() > bound => Some(format!( + "q{}: latency {:.1} ms per evaluation (compaction {:.1} ms + query {:.1} ms) \ is over its {bound} ms bound", - query + 1, - latency.total_ms(), - latency.compaction_ms, - latency.query_ms - )) - } + query + 1, + latency.total_ms(), + latency.compaction_ms, + latency.query_ms + )), _ => None, }) } @@ -4025,7 +4023,7 @@ mod tests { QueryDemand { recurrence: repeating(MINUTE), predictability: asap_types::workload::Predictability::Predictable { known_at: None }, - response_latency: LatencyRequirement::Unspecified, + max_latency_ms: None, } } @@ -4162,7 +4160,7 @@ mod tests { assert!(b1.query_ms < b2.query_ms, "{b1:?} vs {b2:?}"); let bound = (b1.query_ms + b2.query_ms) / 2.0; let demand = QueryDemand { - response_latency: LatencyRequirement::ExplicitMaxMs(bound), + max_latency_ms: Some(bound), ..every_minute() }; let selection = select_plan( diff --git a/crates/asap-aware-mapping/src/test_support.rs b/crates/asap-aware-mapping/src/test_support.rs index 3fbf66e7a..11a91121d 100644 --- a/crates/asap-aware-mapping/src/test_support.rs +++ b/crates/asap-aware-mapping/src/test_support.rs @@ -6,8 +6,8 @@ use std::rc::Rc; use asap_types::ir::OperatorNode; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, - Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, }; pub(crate) fn lower_promql(query: &str, accuracy: AccuracyTarget) -> Rc { @@ -17,7 +17,7 @@ pub(crate) fn lower_promql(query: &str, accuracy: AccuracyTarget) -> Rc Vec { +fn exact_promql(query: &str) -> Vec { use asap_types::workload::{ - AccuracyRequirement, BatchEntry, PlanningWorkload, Query, QueryLanguage, QueryRequirements, - QueryWorkload, + BatchEntry, PlanningWorkload, Query, QueryLanguage, QueryRequirements, QueryWorkload, }; let workload = PlanningWorkload { query_workload: QueryWorkload { @@ -192,7 +191,7 @@ fn implicit_exact_promql(query: &str) -> Vec { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::ImplicitExact, + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Default::default(), @@ -215,7 +214,7 @@ fn implicit_exact_promql(query: &str) -> Vec { #[test] fn example_1_exact_q1_keeps_exact_accumulators_only() { - let roots = implicit_exact_promql("sum by (job) (rate(http_requests_total[1m]))"); + let roots = exact_promql("sum by (job) (rate(http_requests_total[1m]))"); let candidates = generate_per_computation_candidates(roots.into_iter().enumerate().collect()).unwrap(); let found: Vec<_> = candidates @@ -666,7 +665,7 @@ fn global_aggregate_having_stays_above() { /// its exact Sum accumulator. #[test] fn example_1_exact_q2_prunes_topk_heaps() { - let roots = implicit_exact_promql("topk by (job) (10, sum_over_time(http_requests_total[1m]))"); + let roots = exact_promql("topk by (job) (10, sum_over_time(http_requests_total[1m]))"); let candidates = generate_per_computation_candidates(roots.into_iter().enumerate().collect()).unwrap(); let found: Vec<_> = candidates @@ -762,7 +761,7 @@ fn scalar_reference_filter_is_not_having() { /// PromQL `scalar(...)` operands are scalar references, not `HAVING`. #[test] fn promql_scalar_operand_is_not_having() { - let roots = implicit_exact_promql("http_requests_total > scalar(sum(http_requests_total))"); + let roots = exact_promql("http_requests_total > scalar(sum(http_requests_total))"); let targets = generate_per_computation_candidates(roots.into_iter().enumerate().collect()) .unwrap() .targets; @@ -771,7 +770,7 @@ fn promql_scalar_operand_is_not_having() { assert!(target.having.is_empty(), "{:?}", target.having); } - let roots = implicit_exact_promql("sum by (job) (x) > scalar(count(x))"); + let roots = exact_promql("sum by (job) (x) > scalar(count(x))"); let targets = generate_per_computation_candidates(roots.into_iter().enumerate().collect()) .unwrap() .targets; @@ -1145,7 +1144,7 @@ fn own_having_subquery_is_substituted() { #[test] fn per_series_avg_with_series_identity_composes_from_sum_and_count() { use asap_types::ir::schema_support::with_promql_series_identity; - let [QueryRoot::Operator(root)] = &implicit_exact_promql("avg_over_time(m[5m])")[..] else { + let [QueryRoot::Operator(root)] = &exact_promql("avg_over_time(m[5m])")[..] else { panic!("one operator root"); }; let root = with_promql_series_identity(root).unwrap(); diff --git a/crates/asap-physical-operators/src/physical_planner/candidates.rs b/crates/asap-physical-operators/src/physical_planner/candidates.rs index 9d667b248..1896c8f6d 100644 --- a/crates/asap-physical-operators/src/physical_planner/candidates.rs +++ b/crates/asap-physical-operators/src/physical_planner/candidates.rs @@ -350,9 +350,7 @@ mod tests { query_batch: Some(vec![BatchEntry { query: Query("sum by(job)(rate(m[1m]))".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit( - planner_types::types::AccuracyTarget::exact(), - ), + accuracy: planner_types::types::AccuracyTarget::exact(), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/asap-physical-operators/tests/current_series_heap.rs b/crates/asap-physical-operators/tests/current_series_heap.rs index 35fa03838..9d908ca95 100644 --- a/crates/asap-physical-operators/tests/current_series_heap.rs +++ b/crates/asap-physical-operators/tests/current_series_heap.rs @@ -305,7 +305,7 @@ fn planner_current_series_candidate_compiles_with_dynamic_identity() { query_batch: Some(vec![BatchEntry { query: Query("topk by(job)(1, m)".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::exact()), + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/asap-physical-operators/tests/deployment_computation.rs b/crates/asap-physical-operators/tests/deployment_computation.rs index 732dd7b51..c97b2225f 100644 --- a/crates/asap-physical-operators/tests/deployment_computation.rs +++ b/crates/asap-physical-operators/tests/deployment_computation.rs @@ -25,7 +25,7 @@ fn lower_with(query: &str, accuracy: AccuracyTarget) -> Rc Rc { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy.clone()), + accuracy: accuracy.clone(), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/asap-physical-operators/tests/precompute_candidates.rs b/crates/asap-physical-operators/tests/precompute_candidates.rs index 8ee68a1b9..81859d65b 100644 --- a/crates/asap-physical-operators/tests/precompute_candidates.rs +++ b/crates/asap-physical-operators/tests/precompute_candidates.rs @@ -32,7 +32,7 @@ fn exact_promql_root(query: &str) -> std::rc::Rc Vec { .entries() .enumerate() .map(|(index, entry)| { - let accuracy = json!(entry.requirements.accuracy.requested()); + let accuracy = json!(entry.requirements.accuracy.clone()); let mut requirements = json!({ "accuracy": accuracy }); - if let LatencyRequirement::ExplicitMaxMs(ms) = entry.requirements.response_latency { - requirements["latency_ms"] = json!(ms); + if let Some(ms) = entry.requirements.max_latency_ms { + requirements["max_latency_ms"] = json!(ms); } if let QueryRecurrence::Repeated(RepeatedDemand::FixedInterval(interval)) = &entry.recurrence @@ -570,7 +569,7 @@ fn query_batch( .map(|query| BatchEntry { query: Query(query.clone()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy.clone()), + accuracy: accuracy.clone(), ..Default::default() }, predictability: Default::default(), diff --git a/crates/devtools/src/lib.rs b/crates/devtools/src/lib.rs index 346f1d84c..7ad7f8e9c 100644 --- a/crates/devtools/src/lib.rs +++ b/crates/devtools/src/lib.rs @@ -44,7 +44,7 @@ pub fn lower_promql_with_data_ingestion_interval( query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: asap_types::workload::AccuracyRequirement::Explicit(accuracy), + accuracy, ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/devtools/src/planner_layering_examples.rs b/crates/devtools/src/planner_layering_examples.rs index c5ca5d383..f1ab6ac61 100644 --- a/crates/devtools/src/planner_layering_examples.rs +++ b/crates/devtools/src/planner_layering_examples.rs @@ -4,10 +4,10 @@ use asap_types::types::{AccuracyTarget, ErrorMetric}; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataArrival, DataDistribution, DataWorkload, DurationMs, - Evidence, EvidenceSource, LatencyRequirement, MetricType, PlanningWorkload, Predictability, - Query, QueryLanguage, QueryRequirements, QueryTimeScope, QueryWorkload, Rate, RepeatedDemand, - RepeatingEntry, RepetitionInterval, SqlDialect, TimeSelection, TimestampMs, + BatchEntry, DataArrival, DataDistribution, DataWorkload, DurationMs, Evidence, EvidenceSource, + MetricType, PlanningWorkload, Predictability, Query, QueryLanguage, QueryRequirements, + QueryTimeScope, QueryWorkload, Rate, RepeatedDemand, RepeatingEntry, RepetitionInterval, + SqlDialect, TimeSelection, TimestampMs, }; pub fn declared(value: T) -> Evidence { @@ -50,12 +50,12 @@ pub const EXAMPLE1_Q2: &str = "topk by (job) (10, sum_over_time(http_requests_to /// `http_requests_total` is declared a counter: its samples are never /// negative. pub fn example1() -> PlanningWorkload { - let panel = |query: &str, accuracy, response_latency| RepeatingEntry { + let panel = |query: &str, accuracy, max_latency_ms| RepeatingEntry { query: Query(query.into()), demand: RepeatedDemand::FixedInterval(RepetitionInterval(10_000)), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy), - response_latency, + accuracy, + max_latency_ms, }, predictability: Predictability::Predictable { known_at: None }, time_selection: TimeSelection { @@ -69,15 +69,11 @@ pub fn example1() -> PlanningWorkload { language: QueryLanguage::PromQL, query_batch: None, repeating_queries: Some(vec![ - panel( - EXAMPLE1_Q1, - AccuracyTarget::exact(), - LatencyRequirement::Unspecified, - ), + panel(EXAMPLE1_Q1, AccuracyTarget::exact(), None), panel( EXAMPLE1_Q2, AccuracyTarget::epsilon_delta(0.01, 0.001), - LatencyRequirement::ExplicitMaxMs(100.0), + Some(100.0), ), ]), }, @@ -137,10 +133,8 @@ pub fn example2() -> PlanningWorkload { query: Query((*query).into()), demand: RepeatedDemand::FixedInterval(RepetitionInterval(10_000)), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::epsilon_delta( - epsilon, delta, - )), - response_latency: LatencyRequirement::Unspecified, + accuracy: AccuracyTarget::epsilon_delta(epsilon, delta), + max_latency_ms: None, }, predictability: Predictability::Predictable { known_at: None }, time_selection: TimeSelection { @@ -193,10 +187,8 @@ pub enum PatternARecurrence { fn pattern_a_requirements() -> QueryRequirements { QueryRequirements { - accuracy: AccuracyRequirement::Explicit( - AccuracyTarget::epsilon_delta(0.005, 0.01).with_metric(ErrorMetric::Rank), - ), - response_latency: LatencyRequirement::Unspecified, + accuracy: AccuracyTarget::epsilon_delta(0.005, 0.01).with_metric(ErrorMetric::Rank), + max_latency_ms: None, } } @@ -273,10 +265,9 @@ pub fn pattern_b() -> PlanningWorkload { PATTERN_B_INTERVAL_MS as u32, )), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit( - AccuracyTarget::epsilon_delta(0.01, 0.01).with_metric(ErrorMetric::Rank), - ), - response_latency: LatencyRequirement::ExplicitMaxMs(200.0), + accuracy: AccuracyTarget::epsilon_delta(0.01, 0.01) + .with_metric(ErrorMetric::Rank), + max_latency_ms: Some(200.0), }, predictability: Predictability::Predictable { known_at: None }, time_selection: TimeSelection { diff --git a/crates/devtools/src/planning_stages.rs b/crates/devtools/src/planning_stages.rs index dcf9cdef4..91b4d0982 100644 --- a/crates/devtools/src/planning_stages.rs +++ b/crates/devtools/src/planning_stages.rs @@ -69,7 +69,7 @@ pub fn lower_sql_roots( &entry.query.0, catalog, dialect.clone(), - entry.requirements.accuracy.requested(), + entry.requirements.accuracy.clone(), )) .map(QueryRoot::Operator) .map_err(|e| format!("lowering: {e}")) @@ -145,7 +145,7 @@ pub fn run_planning_stages( let targets: Vec<_> = workload .query_workload .entries() - .map(|entry| entry.requirements.accuracy.requested()) + .map(|entry| entry.requirements.accuracy.clone()) .collect(); let demand: Vec<_> = workload .query_workload diff --git a/crates/frontend-metricsql/src/lib.rs b/crates/frontend-metricsql/src/lib.rs index d8981b6ee..1dc746246 100644 --- a/crates/frontend-metricsql/src/lib.rs +++ b/crates/frontend-metricsql/src/lib.rs @@ -68,7 +68,7 @@ pub fn lower_metricsql_query_workload( .map(|entry| { lower_metricsql_query( &entry.query.0, - entry.requirements.accuracy.requested(), + entry.requirements.accuracy.clone(), Duration::from_millis(interval_ms), ) }) diff --git a/crates/frontend-promql/src/lib.rs b/crates/frontend-promql/src/lib.rs index b252ef952..a86d64ad9 100644 --- a/crates/frontend-promql/src/lib.rs +++ b/crates/frontend-promql/src/lib.rs @@ -101,7 +101,7 @@ fn lower_promql_query_workload_inner( .map(|entry| { let root = promql::PromqlLowerer::lower_query_with_ingestion_interval( &entry.query.0, - &entry.requirements.accuracy.requested(), + &entry.requirements.accuracy.clone(), std::time::Duration::from_millis(interval_ms), )?; Ok(root) diff --git a/crates/frontend-promql/tests/promql_lowering.rs b/crates/frontend-promql/tests/promql_lowering.rs index 9e777fd31..b311b0a05 100644 --- a/crates/frontend-promql/tests/promql_lowering.rs +++ b/crates/frontend-promql/tests/promql_lowering.rs @@ -11,8 +11,8 @@ use asap_types::pre_asap::{ }; use asap_types::types::{AccuracyTarget, ErrorMetric}; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, - Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, }; use asap_frontend_promql::{lower_promql_workload, PromqlError as LoweringError}; @@ -1179,7 +1179,7 @@ fn batch_lowers_each_entry_and_reads_per_query_accuracy() { BatchEntry { query: Query("quantile_over_time(0.9, b[5m])".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::epsilon(0.02)), + accuracy: AccuracyTarget::epsilon(0.02), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/frontend-promql/tests/support.rs b/crates/frontend-promql/tests/support.rs index 8ec281958..8108c001d 100644 --- a/crates/frontend-promql/tests/support.rs +++ b/crates/frontend-promql/tests/support.rs @@ -7,8 +7,8 @@ use asap_types::ir::{NonASAPOp, OperatorNode, ScalarExpr}; use asap_types::pre_asap::ScalarValue; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, - Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, }; pub fn workload(query: &str, accuracy: AccuracyTarget) -> PlanningWorkload { @@ -18,7 +18,7 @@ pub fn workload(query: &str, accuracy: AccuracyTarget) -> PlanningWorkload { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy), + accuracy, ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/frontend-sql/src/lib.rs b/crates/frontend-sql/src/lib.rs index a06f9de4d..97eac2be8 100644 --- a/crates/frontend-sql/src/lib.rs +++ b/crates/frontend-sql/src/lib.rs @@ -99,7 +99,7 @@ pub async fn lower_sql_batch( let mut results = Vec::with_capacity(entries.len()); for entry in entries { - let accuracy = entry.requirements.accuracy.requested(); + let accuracy = entry.requirements.accuracy.clone(); results.push(lower_sql_dialect(&entry.query.0, catalog, dialect.clone(), accuracy).await); } results diff --git a/crates/frontend-sql/tests/frequency_l2.rs b/crates/frontend-sql/tests/frequency_l2.rs index 76c87cebc..2006a69e0 100644 --- a/crates/frontend-sql/tests/frequency_l2.rs +++ b/crates/frontend-sql/tests/frequency_l2.rs @@ -126,16 +126,16 @@ async fn frequency_empty_input_guard_uses_an_exact_count() { #[tokio::test] async fn batch_lowering_recognizes_frequency_l2() { use asap_types::workload::{ - AccuracyRequirement, BatchEntry, LatencyRequirement, Predictability, Query, QueryLanguage, - QueryRequirements, QueryWorkload, SqlDialect, TimeSelection, + BatchEntry, Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, + SqlDialect, TimeSelection, }; let workload = QueryWorkload { language: QueryLanguage::SQL(SqlDialect::DataFusionSQL), query_batch: Some(vec![BatchEntry { query: Query(CAST_COUNT.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::exact()), - response_latency: LatencyRequirement::Unspecified, + accuracy: AccuracyTarget::exact(), + max_latency_ms: None, }, predictability: Predictability::Unknown, invocations: 1, diff --git a/crates/integration-tests/src/lib.rs b/crates/integration-tests/src/lib.rs index b84e9d630..846a67d46 100644 --- a/crates/integration-tests/src/lib.rs +++ b/crates/integration-tests/src/lib.rs @@ -17,8 +17,8 @@ pub mod fixtures { use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, - Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, TimeSelection, }; use std::rc::Rc; @@ -46,7 +46,7 @@ pub mod fixtures { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy), + accuracy, ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/integration-tests/tests/operator_design_examples.rs b/crates/integration-tests/tests/operator_design_examples.rs index f0a203e4a..47760bed8 100644 --- a/crates/integration-tests/tests/operator_design_examples.rs +++ b/crates/integration-tests/tests/operator_design_examples.rs @@ -283,7 +283,7 @@ async fn batch_planning_replaces_summary_operators() { .map(|query| BatchEntry { query: Query((*query).into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::exact()), + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Predictability::Unknown, diff --git a/crates/integration-tests/tests/planner_layering_example2.rs b/crates/integration-tests/tests/planner_layering_example2.rs index 623944a94..b2c73f56e 100644 --- a/crates/integration-tests/tests/planner_layering_example2.rs +++ b/crates/integration-tests/tests/planner_layering_example2.rs @@ -26,10 +26,9 @@ use asap_types::post_asap::{ use asap_types::pre_asap::DataType; use asap_types::types::{AccuracyScope, AccuracyTarget}; use asap_types::workload::{ - AccuracyRequirement, DataArrival, DataDistribution, DataWorkload, DurationMs, - LatencyRequirement, PlanningWorkload, Predictability, Query, QueryLanguage, QueryRequirements, - QueryTimeScope, QueryWorkload, Rate, RepeatedDemand, RepeatingEntry, RepetitionInterval, - SqlDialect, TimeSelection, + DataArrival, DataDistribution, DataWorkload, DurationMs, PlanningWorkload, Predictability, + Query, QueryLanguage, QueryRequirements, QueryTimeScope, QueryWorkload, Rate, RepeatedDemand, + RepeatingEntry, RepetitionInterval, SqlDialect, TimeSelection, }; use planner_layering_common::*; @@ -59,11 +58,11 @@ fn panel(query: &str, (epsilon, delta): (f64, f64), scope: AccuracyScope) -> Rep query: Query(query.into()), demand: RepeatedDemand::FixedInterval(RepetitionInterval(10_000)), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget { + accuracy: AccuracyTarget { scope, ..AccuracyTarget::epsilon_delta(epsilon, delta) - }), - response_latency: LatencyRequirement::Unspecified, + }, + max_latency_ms: None, }, predictability: Predictability::Predictable { known_at: None }, time_selection: TimeSelection { @@ -156,7 +155,7 @@ async fn lower_sql(workload: &PlanningWorkload) -> Vec { &entry.query.0, &catalog(), SqlDialect::DataFusionSQL, - entry.requirements.accuracy.requested(), + entry.requirements.accuracy.clone(), ) .await .unwrap_or_else(|e| panic!("{}: {e}", entry.query.0)); @@ -678,10 +677,10 @@ fn stage3_plan_selection_accepts_kmv_for_any_failure_probability_without_a_bound .repeating_queries .as_mut() .expect("repeating queries")[0]; - q1.requirements.accuracy = AccuracyRequirement::Explicit(AccuracyTarget { + q1.requirements.accuracy = AccuracyTarget { scope: AccuracyScope::PerValue, ..AccuracyTarget::epsilon_delta(0.02, delta) - }); + }; let run = run_stages(&workload, lower_promql(&workload)); for id in q1_only_candidates(&run, "Kmv") { assert!( @@ -952,7 +951,7 @@ fn stage3_plan_selection_selected_kmv_plan_executes_end_to_end() { let entries: Vec<_> = workload.query_workload.entries().collect(); let targets: Vec<_> = entries .iter() - .map(|e| Some(e.requirements.accuracy.requested())) + .map(|e| Some(e.requirements.accuracy.clone())) .collect(); let demand: Vec<_> = entries .iter() diff --git a/crates/integration-tests/tests/stage1_logical_asap_optimization.rs b/crates/integration-tests/tests/stage1_logical_asap_optimization.rs index e97046aa8..5b50ccaa6 100644 --- a/crates/integration-tests/tests/stage1_logical_asap_optimization.rs +++ b/crates/integration-tests/tests/stage1_logical_asap_optimization.rs @@ -23,8 +23,8 @@ use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::pre_asap::{ColumnRef, CompareOpKind, ScalarValue}; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Query, - QueryLanguage, QueryRequirements, QueryWorkload, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Query, QueryLanguage, + QueryRequirements, QueryWorkload, }; use futures::StreamExt; @@ -56,7 +56,7 @@ fn promql(query: &str) -> QueryRoot { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy()), + accuracy: accuracy(), ..Default::default() }, predictability: Default::default(), diff --git a/crates/planner/src/lib.rs b/crates/planner/src/lib.rs index 428dac90f..a68f6ffa9 100644 --- a/crates/planner/src/lib.rs +++ b/crates/planner/src/lib.rs @@ -206,7 +206,7 @@ async fn lower(input: &UserInput<'_>) -> Result, &entry.query.0, catalog, dialect.clone(), - entry.requirements.accuracy.requested(), + entry.requirements.accuracy.clone(), ) .await .map_err(|source| PlanError::Lowering { diff --git a/crates/planner/tests/e2e_plan.rs b/crates/planner/tests/e2e_plan.rs index 4eff5bdb7..a78bc7a82 100644 --- a/crates/planner/tests/e2e_plan.rs +++ b/crates/planner/tests/e2e_plan.rs @@ -12,17 +12,17 @@ use asap_planner::{e2e_plan, FrontendInput, PlanError, UserInput, UserInputError use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::types::{AccuracyTarget, ErrorMetric}; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataArrival, DataWorkload, DurationMs, Evidence, - LatencyRequirement, PlanningWorkload, Predictability, Query, QueryLanguage, QueryRequirements, - QueryWorkload, RepeatedDemand, RepeatingEntry, RepetitionInterval, SqlDialect, TimeSelection, + BatchEntry, DataArrival, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, + Query, QueryLanguage, QueryRequirements, QueryWorkload, RepeatedDemand, RepeatingEntry, + RepetitionInterval, SqlDialect, TimeSelection, }; const NOW_MS: u64 = 1_700_000_000_000; fn approximate() -> QueryRequirements { QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::epsilon(0.01)), - response_latency: LatencyRequirement::Unspecified, + accuracy: AccuracyTarget::epsilon(0.01), + max_latency_ms: None, } } @@ -31,9 +31,7 @@ fn approximate() -> QueryRequirements { fn approximate_for(sql: &str) -> QueryRequirements { let mut requirements = approximate(); if sql.contains("percentile") { - requirements.accuracy = AccuracyRequirement::Explicit( - AccuracyTarget::epsilon(0.01).with_metric(ErrorMetric::Rank), - ); + requirements.accuracy = AccuracyTarget::epsilon(0.01).with_metric(ErrorMetric::Rank); } requirements } @@ -127,7 +125,7 @@ async fn facade_plans_match_run_stage1_to_stage3() { let mut roots = Vec::new(); let mut targets = Vec::new(); for (index, entry) in workload.query_workload.entries().enumerate() { - let accuracy = entry.requirements.accuracy.requested(); + let accuracy = entry.requirements.accuracy.clone(); let expr = lower_sql_dialect( &entry.query.0, &catalog, diff --git a/crates/planner/tests/plan_stages.rs b/crates/planner/tests/plan_stages.rs index f391b2126..bb504278a 100644 --- a/crates/planner/tests/plan_stages.rs +++ b/crates/planner/tests/plan_stages.rs @@ -5,8 +5,8 @@ use asap_aware_mapping::pass::{run_stage1_to_stage3, PlanningModels, Stage1ToSta use asap_frontend_promql::lower_promql_query_workload; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Query, - QueryLanguage, QueryRequirements, QueryWorkload, + BatchEntry, DataWorkload, DurationMs, Evidence, PlanningWorkload, Query, QueryLanguage, + QueryRequirements, QueryWorkload, }; const NOW_MS: u64 = 1_700_000_000_000; @@ -19,7 +19,7 @@ fn promql_stages(query: &str, epsilon: f64) -> Stage1ToStage3Run { query_batch: Some(vec![BatchEntry { query: Query(query.into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(target.clone()), + accuracy: target.clone(), ..Default::default() }, predictability: Default::default(), diff --git a/crates/planner/tests/summary_sharing.rs b/crates/planner/tests/summary_sharing.rs index 83ee63a3c..2773903c1 100644 --- a/crates/planner/tests/summary_sharing.rs +++ b/crates/planner/tests/summary_sharing.rs @@ -19,9 +19,9 @@ use asap_types::pre_asap::agg_intent::default_quantile; use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::types::{AccuracyTarget, ErrorMetric}; use asap_types::workload::{ - AccuracyRequirement, DataArrival, DataWorkload, DurationMs, Evidence, LatencyRequirement, - PlanningWorkload, Predictability, Query, QueryLanguage, QueryRequirements, QueryWorkload, Rate, - RepeatedDemand, RepeatingEntry, RepetitionInterval, SqlDialect, TimeSelection, + DataArrival, DataWorkload, DurationMs, Evidence, PlanningWorkload, Predictability, Query, + QueryLanguage, QueryRequirements, QueryWorkload, Rate, RepeatedDemand, RepeatingEntry, + RepetitionInterval, SqlDialect, TimeSelection, }; const NOW_MS: u64 = 1_700_000_000_000; @@ -39,8 +39,8 @@ fn requested(query: &str, epsilon: f64) -> AccuracyTarget { fn requirements(query: &str, epsilon: f64) -> QueryRequirements { QueryRequirements { - accuracy: AccuracyRequirement::Explicit(requested(query, epsilon)), - response_latency: LatencyRequirement::Unspecified, + accuracy: requested(query, epsilon), + max_latency_ms: None, } } diff --git a/crates/types/src/workload.rs b/crates/types/src/workload.rs index d196368d1..bd29c45ee 100644 --- a/crates/types/src/workload.rs +++ b/crates/types/src/workload.rs @@ -56,48 +56,29 @@ pub enum QueryLanguage { // ── Per-query requirements ──────────────────────────────────────────────────── -/// Whether the caller explicitly requested an accuracy target or inherited -/// the normalized exact default. An explicit request may omit its metric -/// ([`AccuracyTarget`]). -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum AccuracyRequirement { - Explicit(AccuracyTarget), - ImplicitExact, -} - -impl AccuracyRequirement { - pub fn requested(&self) -> AccuracyTarget { - match self { - Self::Explicit(requested) => requested.clone(), - Self::ImplicitExact => AccuracyTarget::exact(), - } - } -} - -/// Optional maximum wall-clock response time for one query execution. -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum LatencyRequirement { - ExplicitMaxMs(f64), - #[default] - Unspecified, -} - /// Independent accuracy and response-latency constraints attached to one /// query in the workload. +/// +/// JSON: `{"accuracy": {"error": 0.01, "metric": "rank"}, "max_latency_ms": +/// 200.0}`. An omitted `accuracy` is [`AccuracyTarget::exact`] and an +/// omitted `max_latency_ms` imposes no bound. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct QueryRequirements { - pub accuracy: AccuracyRequirement, - pub response_latency: LatencyRequirement, + /// The accuracy the query's answer must meet. + #[serde(default = "AccuracyTarget::exact")] + pub accuracy: AccuracyTarget, + /// The longest one evaluation may take, in milliseconds; `None` for no + /// bound. + #[serde(default)] + pub max_latency_ms: Option, } impl Default for QueryRequirements { fn default() -> Self { Self { - accuracy: AccuracyRequirement::ImplicitExact, - response_latency: LatencyRequirement::Unspecified, + accuracy: AccuracyTarget::exact(), + max_latency_ms: None, } } } @@ -411,18 +392,18 @@ pub struct QueryWorkloadEntry { /// # Example /// /// ``` -/// use asap_types::workload::{LatencyRequirement, Predictability, QueryDemand, QueryRecurrence}; +/// use asap_types::workload::{Predictability, QueryDemand, QueryRecurrence}; /// /// // Anything not declared: unknown predictability, no latency bound. /// let demand = QueryDemand::from(QueryRecurrence::Unknown); /// assert_eq!(demand.predictability, Predictability::Unknown); -/// assert_eq!(demand.response_latency, LatencyRequirement::Unspecified); +/// assert_eq!(demand.max_latency_ms, None); /// ``` #[derive(Debug, Clone, PartialEq)] pub struct QueryDemand { pub recurrence: QueryRecurrence, pub predictability: Predictability, - pub response_latency: LatencyRequirement, + pub max_latency_ms: Option, } impl From<&QueryWorkloadEntry> for QueryDemand { @@ -430,7 +411,7 @@ impl From<&QueryWorkloadEntry> for QueryDemand { Self { recurrence: entry.recurrence.clone(), predictability: entry.predictability.clone(), - response_latency: entry.requirements.response_latency, + max_latency_ms: entry.requirements.max_latency_ms, } } } @@ -442,7 +423,7 @@ impl From for QueryDemand { Self { recurrence, predictability: Predictability::Unknown, - response_latency: LatencyRequirement::Unspecified, + max_latency_ms: None, } } } @@ -740,7 +721,7 @@ impl PlanningWorkload { } fn validate_entry(entry: &QueryWorkloadEntry) -> Result<(), WorkloadError> { - if let LatencyRequirement::ExplicitMaxMs(ms) = entry.requirements.response_latency { + if let Some(ms) = entry.requirements.max_latency_ms { if !ms.is_finite() || ms < 0.0 { return Err(WorkloadError::InvalidLatency(ms)); } @@ -849,7 +830,6 @@ mod tests { } } - /// A stream norm is a finite, non-negative magnitude. #[test] fn stream_norms_must_be_finite_and_non_negative() { @@ -1014,10 +994,8 @@ mod tests { query: Query("rate(requests_total[5m])".into()), demand: RepeatedDemand::FixedInterval(RepetitionInterval(10_000)), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::epsilon_delta( - 0.01, 0.001, - )), - response_latency: LatencyRequirement::ExplicitMaxMs(100.0), + accuracy: AccuracyTarget::epsilon_delta(0.01, 0.001), + max_latency_ms: Some(100.0), }, predictability: Predictability::Predictable { known_at: None }, time_selection: TimeSelection { diff --git a/docs/design_docs/architecture/input-output-workflow.md b/docs/design_docs/architecture/input-output-workflow.md index 18221035e..7fee48691 100644 --- a/docs/design_docs/architecture/input-output-workflow.md +++ b/docs/design_docs/architecture/input-output-workflow.md @@ -201,8 +201,8 @@ fields expand as follows: | Structure | Field | Meaning | |---|---|---| -| `QueryRequirements` | `accuracy` | `Explicit(AccuracyTarget)` or `ImplicitExact`. Use an explicit target when approximation is allowed. | -| `QueryRequirements` | `response_latency` | An optional finite, non-negative maximum in milliseconds. The default is unspecified. | +| `QueryRequirements` | `accuracy` | An `AccuracyTarget`; omitted, it is `AccuracyTarget::exact()`. Set ε (and δ) when approximation is allowed. | +| `QueryRequirements` | `max_latency_ms` | An optional finite, non-negative maximum in milliseconds for one evaluation; omitted, there is no bound. | | `TimeSelection` | `scope` | `RealTime`, `Longitudinal`, `Mixed`, or `Unknown`. | | `TimeSelection` | `lookback` | Optional event-time duration selected before the upper bound. | | `TimeSelection` | `as_of` | Optional fixed upper-bound timestamp; `None` means planning/evaluation time. | diff --git a/docs/develop_docs/library-api.md b/docs/develop_docs/library-api.md index 0ace620b6..8e1685496 100644 --- a/docs/develop_docs/library-api.md +++ b/docs/develop_docs/library-api.md @@ -86,7 +86,7 @@ that a supported candidate exists. ```rust use asap_frontend_promql::lower_promql_workload; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, Query, + BatchEntry, DataWorkload, DurationMs, Evidence, Query, PlanningWorkload, QueryLanguage, QueryRequirements, QueryWorkload, }; use asap_types::types::AccuracyTarget; @@ -98,7 +98,7 @@ fn main() -> Result<(), Box> { query_batch: Some(vec![BatchEntry { query: Query("sum(latency)".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::Exact), + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Default::default(), @@ -200,7 +200,7 @@ The default cost model is suitable for inspection, not deployment calibration. ```rust use asap_frontend_promql::lower_promql_workload; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, Query, + BatchEntry, DataWorkload, DurationMs, Evidence, Query, PlanningWorkload, QueryLanguage, QueryRequirements, QueryWorkload, }; use asap_aware_mapping::{ @@ -217,7 +217,7 @@ fn main() -> Result<(), Box> { query_batch: Some(vec![BatchEntry { query: Query("quantile(0.99, latency)".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy.clone()), + accuracy: accuracy.clone(), ..Default::default() }, predictability: Default::default(), @@ -348,7 +348,7 @@ replacement::default_strategies_with_evidence<'a>( ```rust use asap_frontend_promql::lower_promql_workload; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, Query, + BatchEntry, DataWorkload, DurationMs, Evidence, Query, PlanningWorkload, QueryLanguage, QueryRequirements, QueryWorkload, }; use asap_aware_mapping::{ @@ -365,7 +365,7 @@ fn main() -> Result<(), Box> { query_batch: Some(vec![BatchEntry { query: Query("quantile(0.99, latency)".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(accuracy.clone()), + accuracy: accuracy.clone(), ..Default::default() }, predictability: Default::default(), @@ -503,7 +503,7 @@ ingestion rate. `PlanningWorkload::validate()` shares these checks. | Type/input | Current behavior | Caller responsibility | | --- | --- | --- | -| `QueryRequirements::default()` | `ImplicitExact`, unspecified response latency | Pass approximation explicitly and thread per-root requirements into search | +| `QueryRequirements::default()` | `AccuracyTarget::exact()`, no latency bound (`max_latency_ms: None`) | Pass approximation explicitly and thread per-root requirements into search | | `DataWorkload::default()` | Unknown arrival, unknown evidence | Supply facts needed for the requested comparisons | | `Evidence::default()` | No value, unknown source | Unknown/stale evidence is not zero; provide scoped valid observations | | `DefaultCostModel` | Built-in ordering/sizing and structural cost hooks | Supply deployment evidence for calibrated comparisons | @@ -578,7 +578,7 @@ planning. ```rust use asap_frontend_promql::lower_promql_workload; use asap_types::workload::{ - AccuracyRequirement, BatchEntry, DataWorkload, DurationMs, Evidence, Query, + BatchEntry, DataWorkload, DurationMs, Evidence, Query, PlanningWorkload, QueryLanguage, QueryRequirements, QueryWorkload, }; use asap_aware_mapping::{search_workload, DefaultCostModel}; @@ -591,7 +591,7 @@ fn main() -> Result<(), Box> { query_batch: Some(vec![BatchEntry { query: Query("sum(latency)".into()), requirements: QueryRequirements { - accuracy: AccuracyRequirement::Explicit(AccuracyTarget::Exact), + accuracy: AccuracyTarget::exact(), ..Default::default() }, predictability: Default::default(), diff --git a/tools/dag-viewer/app.js b/tools/dag-viewer/app.js index 2189ea0d7..a575a0382 100644 --- a/tools/dag-viewer/app.js +++ b/tools/dag-viewer/app.js @@ -192,7 +192,7 @@ $('queries').innerHTML = doc.workload.queries.map((q) => { const r = q.requirements || {}; const acc = accuracyText(r.accuracy, r.default_metric); - const req = [acc && `accuracy ${acc}`, r.latency_ms && `latency ≤ ${r.latency_ms} ms`, r.repeat_interval_ms && `every ${r.repeat_interval_ms / 1000} s`].filter(Boolean).join(' · '); + const req = [acc && `accuracy ${acc}`, r.max_latency_ms && `latency ≤ ${r.max_latency_ms} ms`, r.repeat_interval_ms && `every ${r.repeat_interval_ms / 1000} s`].filter(Boolean).join(' · '); return `
${esc(q.id)} · ${esc(q.language)}${esc(q.text)}${req ? `${esc(req)}` : ''}
`; }).join(''); const count = (status) => rows.filter((r) => r.status === status).length; diff --git a/tools/dag-viewer/examples/planner-layering-example1.json b/tools/dag-viewer/examples/planner-layering-example1.json index c92b7b17d..85bf14d9e 100644 --- a/tools/dag-viewer/examples/planner-layering-example1.json +++ b/tools/dag-viewer/examples/planner-layering-example1.json @@ -105466,7 +105466,7 @@ "scope": "whole_result" }, "default_metric": "absolute_stream_l1", - "latency_ms": 100.0, + "max_latency_ms": 100.0, "repeat_interval_ms": 10000 }, "text": "topk by (job) (10, sum_over_time(http_requests_total[1m]))" From b430d56e69f75bf70d6294d707b537d2d442f4bd Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:57:51 +0000 Subject: [PATCH 5/8] refactor(planner)!: planning takes the workload entries; QueryDemand removed optimize_physical_asap, physical_candidate_count, select_plan, run_stage1_to_stage3 (and _from_pass1), run_stage2_and_stage3 and run_planning_stages_over take &[QueryWorkloadEntry], one per query in root order, and read the accuracy target, latency bound, recurrence and predictability from it. The separate targets and recurrence parameters and QueryDemand are removed. Every query now has a target (default exact), so Stage 3's internal per-query targets are no longer optional. QueryWorkloadEntry, Query and QueryRecurrence derive Default (empty query, exact, no latency bound, unknown predictability and recurrence). --- .../src/pass/stage1_to_stage3.rs | 43 ++-- .../src/stage2_physical_asap_optimization.rs | 68 +++--- .../src/stage3_plan_selection.rs | 202 ++++++++---------- crates/asap-aware-mapping/src/test_support.rs | 30 ++- .../src/physical_planner/candidates.rs | 5 +- .../tests/common/mod.rs | 9 +- crates/devtools/src/bin/stage_pipeline.rs | 22 +- crates/devtools/src/planning_stages.rs | 31 +-- crates/frontend-promql/tests/support.rs | 18 +- crates/frontend-sql/tests/pearson_corr.rs | 9 +- crates/integration-tests/src/lib.rs | 11 +- .../tests/planner_layering_example1.rs | 12 +- .../tests/planner_layering_example2.rs | 11 +- crates/planner/tests/e2e_plan.rs | 15 +- crates/planner/tests/plan_stages.rs | 7 +- crates/planner/tests/summary_sharing.rs | 11 +- crates/types/src/workload.rs | 66 ++---- .../planner-layering-example4-acceptance.md | 5 +- 18 files changed, 268 insertions(+), 307 deletions(-) diff --git a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs index 47a07a1cd..fe5ff4b90 100644 --- a/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs +++ b/crates/asap-aware-mapping/src/pass/stage1_to_stage3.rs @@ -45,9 +45,8 @@ use asap_types::ir::flat::flatten; use asap_types::ir::schema_support::with_promql_series_identity; use asap_types::ir::{ASAPOp, OperatorNode, QueryRoot}; use asap_types::post_asap::{FieldDataType, SketchAlgorithm}; -use asap_types::types::AccuracyTarget; use asap_types::workload::{ - DataWorkload, QueryDemand, QueryLanguage, QueryRecurrence, RepeatedDemand, + DataWorkload, QueryLanguage, QueryRecurrence, QueryWorkloadEntry, RepeatedDemand, }; use super::{OptimizationInput, OptimizationPass, OptimizeError, PlanOutput, QueryPlan}; @@ -154,23 +153,21 @@ impl Stage1ToStage3Run { } /// Run Stage 1 → Stage 2 → Stage 3 over the frontends' `roots`, enumerating every -/// whole-workload candidate. `targets[i]` is the accuracy -/// requirement of `roots[i]` (`None` imposes none) and `demand[i]` how it is -/// demanded (recurrence, predictability, latency bound). Only a Pass 1 failure is +/// whole-workload candidate. `entries[i]` is the workload entry of +/// `roots[i]`: its accuracy target, latency bound, recurrence and +/// predictability. Only a Pass 1 failure is /// an error; a candidate that does not compose or cannot be implemented is /// listed with its reason, and a failed selection is reported in the run. pub fn run_stage1_to_stage3( roots: Vec<(Id, QueryRoot)>, - targets: &[Option], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, models: PlanningModels<'_>, ) -> Result, PerComputationCandidateError> { let per_computation = generate_per_computation_candidates(roots)?; Ok(run_stage1_to_stage3_from_pass1( per_computation, - targets, - demand, + entries, data, models, )) @@ -620,14 +617,13 @@ fn readers_of(roots: &[QueryRoot], node: &Rc) -> Vec { /// enumerating. pub fn run_stage1_to_stage3_from_pass1( per_computation: PerComputationCandidates, - targets: &[Option], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, models: PlanningModels<'_>, ) -> Stage1ToStage3Run { - let recurrence: Vec<_> = demand.iter().map(|d| d.recurrence.clone()).collect(); + let recurrence: Vec<_> = entries.iter().map(|e| e.recurrence.clone()).collect(); let stage1 = stage1_logical_asap_optimization(&per_computation, &recurrence).collect(); - run_stage2_and_stage3(per_computation, stage1, targets, demand, data, models) + run_stage2_and_stage3(per_computation, stage1, entries, data, models) } /// Stage 2 and Stage 3 over `stage1`, the Stage 1 candidates of @@ -638,8 +634,7 @@ pub fn run_stage1_to_stage3_from_pass1( pub fn run_stage2_and_stage3( per_computation: PerComputationCandidates, stage1: Vec, - targets: &[Option], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, models: PlanningModels<'_>, ) -> Stage1ToStage3Run { @@ -652,7 +647,7 @@ pub fn run_stage2_and_stage3( let number = index + 1; let id = format!("L{number}"); if let Ok(roots) = &candidate.roots { - match optimize_physical_asap(&id, roots, demand, data) { + match optimize_physical_asap(&id, roots, entries, data) { Ok(implemented) => { for (k, mut p) in implemented.into_iter().enumerate() { p.id = match k { @@ -684,7 +679,8 @@ pub fn run_stage2_and_stage3( roots: candidate.roots, }); } - let selection = select_plan(&physical, targets, demand, data, models); + let selection = select_plan(&physical, entries, data, models); + let targets = &crate::stage3_plan_selection::accuracy_targets(entries); let selected_logical = selection.as_ref().ok().and_then(|selection| { let from = &physical .iter() @@ -771,18 +767,9 @@ impl OptimizationPass for Stage1ToStage3Pass { ) .collect(); roots.sort_by_key(|(index, _)| *index); - let targets: Vec<_> = workload - .query_workload() - .entries() - .map(|entry| Some(entry.requirements.accuracy.clone())) - .collect(); - let demand: Vec<_> = workload - .query_workload() - .entries() - .map(|entry| QueryDemand::from(&entry)) - .collect(); + let entries: Vec<_> = workload.query_workload().entries().collect(); let data = workload.data_workload().cloned().unwrap_or_default(); - let run = run_stage1_to_stage3(roots, &targets, &demand, &data, input.models)?; + let run = run_stage1_to_stage3(roots, &entries, &data, input.models)?; let selection = run.stage3_plan_selection?; let roots = selection.plan.clone(); let mut output = PlanOutput::new(Vec::new()); diff --git a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs index a79790bb9..0ee9aafec 100644 --- a/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs +++ b/crates/asap-aware-mapping/src/stage2_physical_asap_optimization.rs @@ -79,7 +79,7 @@ use asap_types::pre_asap::column_resolution::resolve_column_ref; use asap_types::pre_asap::expr_ir::ColumnRef; use asap_types::pre_asap::{AggIntent, Reduction}; use asap_types::workload::{ - DataArrival, DataWorkload, Predictability, QueryDemand, QueryRecurrence, RepeatedDemand, + DataArrival, DataWorkload, Predictability, QueryRecurrence, QueryWorkloadEntry, RepeatedDemand, }; use thiserror::Error; @@ -200,18 +200,20 @@ impl MaterializationCandidate { /// Stage 2 for one CandidateLogicalASAPDAG: implement every operator /// (physical operator implementation), then one physical candidate per /// materialization assignment of its mat_candidates, the all-`NotMaterialized` one -/// first. `demand[i]` is how query `i` (`roots[i]`) is demanded; a missing -/// entry is unknown. `id` is left empty for the caller to name. Sharing between `roots` is preserved: one memo serves the whole -/// workload. +/// first. `entries[i]` is the workload entry of query `i` (`roots[i]`): +/// its recurrence and predictability decide whether state may be kept from +/// ingestion time; a missing entry is unknown. `id` is left empty for the +/// caller to name. Sharing between `roots` is preserved: one memo serves the +/// whole workload. pub fn optimize_physical_asap( from_logical: &str, roots: &[QueryRoot], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, ) -> Result, PhysicalASAPOptimizationError> { let mut memo = HashMap::new(); let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; - let mat_candidates = materialization_candidates(&implemented, demand, data); + let mat_candidates = materialization_candidates(&implemented, entries, data); let mut candidates = Vec::new(); for assignment in materialization_assignments(&mat_candidates) { let materialized: Vec<_> = mat_candidates @@ -269,13 +271,13 @@ pub fn optimize_physical_asap( /// implemented. pub fn physical_candidate_count( roots: &[QueryRoot], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, ) -> Result { let mut memo = HashMap::new(); let implemented = map_roots(roots, &mut |node| implement(node, &mut memo))?; Ok( - materialization_assignments(&materialization_candidates(&implemented, demand, data)) + materialization_assignments(&materialization_candidates(&implemented, entries, data)) .count(), ) } @@ -292,7 +294,7 @@ fn root_operators(root: &QueryRoot) -> Vec<&Rc> { /// its readers and whether it may run at ingestion time. pub(crate) fn materialization_candidates( roots: &[QueryRoot], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, ) -> Vec { let mut nodes: Vec> = Vec::new(); @@ -322,17 +324,18 @@ pub(crate) fn materialization_candidates( .enumerate() .map(|(c, node)| { let readers = readers[&Rc::as_ptr(node)].clone(); - let at_ingestion = ingestion_eligibility(node, &readers, demand, data).and_then(|()| { - // Only this build and the builds below it at ingestion time. - let mut trial = - MaterializationAssignment::with_default(Materialization::NotMaterialized); - for &v in below[c].iter().chain([&c]) { - trial.set(&nodes[v], Materialization::MatAtIngestion(Medium::Memory)); - } - apply_materialization_timings(node, &trial, &mut TimingMemo::new()) - .map(|_| ()) - .map_err(|e| IngestionPruneReason::UpstreamAtQueryTime(e.to_string())) - }); + let at_ingestion = + ingestion_eligibility(node, &readers, entries, data).and_then(|()| { + // Only this build and the builds below it at ingestion time. + let mut trial = + MaterializationAssignment::with_default(Materialization::NotMaterialized); + for &v in below[c].iter().chain([&c]) { + trial.set(&nodes[v], Materialization::MatAtIngestion(Medium::Memory)); + } + apply_materialization_timings(node, &trial, &mut TimingMemo::new()) + .map(|_| ()) + .map_err(|e| IngestionPruneReason::UpstreamAtQueryTime(e.to_string())) + }); MaterializationCandidate { node: Rc::clone(node), readers, @@ -354,7 +357,7 @@ fn reads_only_time_series(node: &OperatorNode) -> bool { fn ingestion_eligibility( node: &OperatorNode, readers: &[usize], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, ) -> Result<(), IngestionPruneReason> { use IngestionPruneReason as Why; @@ -364,7 +367,8 @@ fn ingestion_eligibility( ) { return Err(Why::NotIngesting); } - let demands: Vec> = readers.iter().map(|&q| demand.get(q)).collect(); + let demands: Vec> = + readers.iter().map(|&q| entries.get(q)).collect(); if demands .iter() .any(|d| !d.is_some_and(|d| matches!(d.recurrence, QueryRecurrence::Repeated(_)))) @@ -964,13 +968,13 @@ mod tests { .collect() } - fn every_minute() -> QueryDemand { - QueryDemand { - recurrence: QueryRecurrence::Repeated(RepeatedDemand::FixedInterval( - RepetitionInterval(MINUTE as u32), - )), + /// A predictable query evaluated every minute. + fn every_minute() -> QueryWorkloadEntry { + QueryWorkloadEntry { predictability: Predictability::Predictable { known_at: None }, - max_latency_ms: None, + ..crate::test_support::entry(QueryRecurrence::Repeated(RepeatedDemand::FixedInterval( + RepetitionInterval(MINUTE as u32), + ))) } } @@ -1044,11 +1048,11 @@ mod tests { arrival: DataArrival::AtRest, ..Default::default() }; - let unknown = QueryDemand { + let unknown = QueryWorkloadEntry { predictability: Predictability::Unknown, ..every_minute() }; - let once = QueryDemand { + let once = QueryWorkloadEntry { recurrence: QueryRecurrence::OneTime { invocations: 1, execute_at: None, @@ -1141,14 +1145,14 @@ mod tests { fn a_whole_window_build_needs_a_known_phase_and_a_window_within_the_interval() { use IngestionPruneReason as Why; let root = summary_root("quantile_over_time(0.99, m[1m])"); - let at = |interval_ms: u32| QueryDemand { + let at = |interval_ms: u32| QueryWorkloadEntry { recurrence: QueryRecurrence::Repeated(RepeatedDemand::FixedIntervalAt { interval: RepetitionInterval(interval_ms), evaluation_phase: TimestampMs(0), }), ..every_minute() }; - let mat_candidates = |root: &QueryRoot, demand: QueryDemand| { + let mat_candidates = |root: &QueryRoot, demand: QueryWorkloadEntry| { let mut memo = HashMap::new(); let implemented = map_roots(std::slice::from_ref(root), &mut |n| implement(n, &mut memo)).unwrap(); diff --git a/crates/asap-aware-mapping/src/stage3_plan_selection.rs b/crates/asap-aware-mapping/src/stage3_plan_selection.rs index 118c4969b..559b3e220 100644 --- a/crates/asap-aware-mapping/src/stage3_plan_selection.rs +++ b/crates/asap-aware-mapping/src/stage3_plan_selection.rs @@ -117,7 +117,7 @@ use asap_types::post_asap::{ use asap_types::pre_asap::{AggIntent, DataType, Reduction, ScalarValue, Schema}; use asap_types::types::{AccuracyScope, AccuracyTarget}; use asap_types::workload::{ - DataWorkload, MetricType, QueryDemand, QueryRecurrence, RepeatedDemand, + DataWorkload, MetricType, QueryRecurrence, QueryWorkloadEntry, RepeatedDemand, }; use thiserror::Error; @@ -211,22 +211,32 @@ impl QueryLatency { } /// The first query whose latency is over its bound, as a rejection reason. -fn latency_violation(cost: &CandidateCost, demand: &[QueryDemand]) -> Option { +fn latency_violation(cost: &CandidateCost, entries: &[QueryWorkloadEntry]) -> Option { cost.latency .iter() - .zip(demand) + .zip(entries) .enumerate() - .find_map(|(query, (latency, demand))| match demand.max_latency_ms { - Some(bound) if latency.total_ms() > bound => Some(format!( - "q{}: latency {:.1} ms per evaluation (compaction {:.1} ms + query {:.1} ms) \ + .find_map( + |(query, (latency, entry))| match entry.requirements.max_latency_ms { + Some(bound) if latency.total_ms() > bound => Some(format!( + "q{}: latency {:.1} ms per evaluation (compaction {:.1} ms + query {:.1} ms) \ is over its {bound} ms bound", - query + 1, - latency.total_ms(), - latency.compaction_ms, - latency.query_ms - )), - _ => None, - }) + query + 1, + latency.total_ms(), + latency.compaction_ms, + latency.query_ms + )), + _ => None, + }, + ) +} + +/// Each entry's accuracy target, as the per-query targets Stage 3 checks. +pub(crate) fn accuracy_targets(entries: &[QueryWorkloadEntry]) -> Vec { + entries + .iter() + .map(|entry| entry.requirements.accuracy.clone()) + .collect() } /// A candidate that was not selected. `valid == false`: it failed a check; @@ -298,15 +308,11 @@ pub struct Selection { #[derive(Debug, Error)] pub enum SelectionError { - #[error( - "candidate {candidate} has {roots} roots but {targets} accuracy targets and \ - {recurrences} recurrences were given" - )] - TargetCount { + #[error("candidate {candidate} has {roots} roots but {entries} workload entries were given")] + EntryCount { candidate: String, roots: usize, - targets: usize, - recurrences: usize, + entries: usize, }, #[error("candidate {candidate}, node {node:?}: {error}")] Cost { @@ -327,28 +333,27 @@ pub enum SelectionError { /// Stage 3 (plan selection): reject candidates that miss a query's accuracy /// target or latency bound, price the rest per second and select the -/// cheapest (the first on ties). `targets[i]` is the requirement of -/// `candidate.roots[i]` (`None` imposes none) and `demand[i]` how it is -/// demanded: how often it is evaluated and its latency bound. +/// cheapest (the first on ties). `entries[i]` is the workload entry of +/// `candidate.roots[i]`: its accuracy target, its latency bound and how +/// often it is evaluated. pub fn select_plan( cands: &[PhysicalCandidate], - targets: &[Option], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, models: PlanningModels<'_>, ) -> Result { + let targets = &accuracy_targets(entries); let mut costs = BTreeMap::new(); let mut accepted = BTreeMap::new(); let mut rejected = Vec::new(); let mut best: Option<(String, f64, Vec)> = None; - let recurrence: Vec = demand.iter().map(|d| d.recurrence.clone()).collect(); + let recurrence: Vec = entries.iter().map(|e| e.recurrence.clone()).collect(); for candidate in cands { - if candidate.roots.len() != targets.len() || candidate.roots.len() != recurrence.len() { - return Err(SelectionError::TargetCount { + if candidate.roots.len() != entries.len() { + return Err(SelectionError::EntryCount { candidate: candidate.id.clone(), roots: candidate.roots.len(), - targets: targets.len(), - recurrences: recurrence.len(), + entries: entries.len(), }); } let candidate = @@ -378,7 +383,7 @@ pub fn select_plan( error, } })?; - if let Some(reason) = latency_violation(&cost, demand) { + if let Some(reason) = latency_violation(&cost, entries) { rejected.push(Rejection { id: candidate.id.clone(), valid: false, @@ -539,7 +544,7 @@ fn at_most_one_row(node: &OperatorNode) -> bool { /// stage binds `G`. fn sized_for_failure_probability( candidate: &PhysicalCandidate, - targets: &[Option], + targets: &[AccuracyTarget], data: &DataWorkload, ) -> Result { let roots = sized_roots(&candidate.roots, targets, data)?; @@ -572,14 +577,14 @@ fn sized_for_failure_probability( /// the selected candidate too. pub fn sized_roots( roots: &[QueryRoot], - targets: &[Option], + targets: &[AccuracyTarget], data: &DataWorkload, ) -> Result, SchemaDerivationError> { let mut required: HashMap<*const OperatorNode, f64> = HashMap::new(); for (root, target) in roots.iter().zip(targets) { let Some((target, delta)) = target - .as_ref() - .and_then(|t| t.failure_probability.map(|delta| (t, delta))) + .failure_probability + .map(|delta| (target, delta)) .filter(|(t, delta)| !t.is_exact() && *delta > 0.0) else { continue; @@ -644,17 +649,13 @@ pub fn sized_roots( /// accepts only guarantees in it (or convertible to it). fn accuracy_check( candidate: &PhysicalCandidate, - targets: &[Option], + targets: &[AccuracyTarget], data: &DataWorkload, models: &PlanningModels<'_>, ) -> Result>, String> { let mut accepted = Vec::with_capacity(targets.len()); for (query, (root, target)) in candidate.roots.iter().zip(targets).enumerate() { let query = query + 1; - let Some(target) = target else { - accepted.push(None); - continue; - }; let mut sketches: Vec = Vec::new(); for node in root_operators(root) .iter() @@ -1959,7 +1960,7 @@ mod tests { use super::*; use crate::accuracy::AccuracyEvidenceProvider; use crate::stage2_physical_asap_optimization::optimize_physical_asap; - use crate::test_support::lower_promql; + use crate::test_support::{entry, entry_with, lower_promql}; use asap_types::ir::{ExprSemantics, ScalarExpr}; use asap_types::post_asap::{ BoundExpr, ErrorMetric, GroupingStrategy, ProbabilityExpr, SketchKind, @@ -1973,10 +1974,6 @@ mod tests { vec![repeating(10_000); n] } - fn every_10s(n: usize) -> Vec { - vec![repeating(10_000).into(); n] - } - /// A query repeating every `interval_ms`. fn repeating(interval_ms: u32) -> QueryRecurrence { QueryRecurrence::Repeated(RepeatedDemand::FixedInterval( @@ -2072,8 +2069,7 @@ mod tests { assert!(!summaries.is_empty()); let selection = select_plan( &candidates, - &[Some(strict)], - &every_10s(1), + &[entry_with(strict, repeating(10_000))], &data(), PlanningModels::builtin(), ) @@ -2112,8 +2108,10 @@ mod tests { let target = AccuracyTarget::epsilon_delta(0.01, 0.001); let selection = select_plan( &candidates(), - &[Some(target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1), + repeating(10_000), + )], &data(), PlanningModels::builtin(), ) @@ -2144,8 +2142,10 @@ mod tests { let data = with_types(&types); let selection = select_plan( &candidates(), - &[Some(target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1), + repeating(10_000), + )], &data, PlanningModels::builtin(), ) @@ -2279,8 +2279,7 @@ mod tests { }; let run = crate::pass::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], - &[Some(target)], - &every_10s(1), + &[entry_with(target, repeating(10_000))], &data, PlanningModels::builtin().with_evidence(&EveryOutputMeasuredExact), ) @@ -2358,22 +2357,6 @@ mod tests { assert!(Rc::ptr_eq(before, after)); } - /// A query without a target constrains nothing: the Count-Min - /// candidate is admitted and priced. - #[test] - fn count_min_is_admitted_without_a_target() { - let selection = select_plan( - &candidates(), - &[None], - &every_10s(1), - &data(), - PlanningModels::builtin(), - ) - .unwrap(); - assert!(selection.costs.contains_key("P2")); - assert!(selection.rejected.iter().all(|r| r.valid)); - } - /// Each node is priced under its DAG id, and the total is the sum; /// every candidate is either selected or rejected as costlier. The /// CountSketch+heap estimate has no analytical guarantee, so deployment @@ -2384,8 +2367,10 @@ mod tests { let target = AccuracyTarget::epsilon_delta(0.01, 0.001); let selection = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::ABSOLUTE_STREAM_L1), + repeating(10_000), + )], &data(), PlanningModels::builtin().with_evidence(&EveryOutputMeasuredExact), ) @@ -2550,8 +2535,7 @@ mod tests { let select = |target: &AccuracyTarget| { select_plan( &candidates, - &[Some(target.clone())], - &every_10s(1), + &[entry_with(target.clone(), repeating(10_000))], &data(), PlanningModels::builtin(), ) @@ -2589,8 +2573,7 @@ mod tests { }; let Err(SelectionError::NoValidCandidate(rejected)) = select_plan( &candidates, - &[Some(whole)], - &every_10s(1), + &[entry_with(whole, repeating(10_000))], &no_cardinality, PlanningModels::builtin(), ) else { @@ -2711,8 +2694,7 @@ mod tests { let select = |metric| { select_plan( &candidates(), - &[Some(target.clone())], - &every_10s(1), + &[entry_with(target.clone(), repeating(10_000))], &counter, PlanningModels::builtin().with_evidence(&EveryOutputMeasuredIn(metric)), ) @@ -2757,8 +2739,10 @@ mod tests { let builtin = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::ABSOLUTE))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::ABSOLUTE), + repeating(10_000), + )], &data(), PlanningModels::builtin(), ) @@ -2776,8 +2760,10 @@ mod tests { let measured = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::ABSOLUTE))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::ABSOLUTE), + repeating(10_000), + )], &data(), PlanningModels::builtin().with_evidence(&EveryOutputMeasuredExact), ) @@ -2822,8 +2808,10 @@ mod tests { let candidates = keeping_state(all_candidates(query, &target)); let selection = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::Rank))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::Rank), + repeating(10_000), + )], &data(), PlanningModels::builtin(), ) @@ -2848,8 +2836,7 @@ mod tests { let candidates = all_candidates(query, &AccuracyTarget::exact()); let selection = select_plan( &candidates, - &[None], - &every_10s(1), + &[entry(repeating(10_000))], &data(), PlanningModels::builtin(), ) @@ -3026,8 +3013,10 @@ mod tests { let candidates = keeping_state(all_candidates("distinct_over_time(x[5m])", &target)); let selection = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::Relative))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::Relative), + repeating(10_000), + )], &data, PlanningModels::builtin(), ) @@ -3051,8 +3040,7 @@ mod tests { candidates.push(twin); let selection = select_plan( &candidates, - &[None], - &every_10s(1), + &[entry(repeating(10_000))], &data(), PlanningModels::builtin(), ) @@ -3073,8 +3061,10 @@ mod tests { let candidates = all_candidates("quantile(0.99, rate(x[5m]))", &target); let selection = select_plan( &candidates, - &[Some(target.target_in(ErrorMetric::Rank))], - &every_10s(1), + &[entry_with( + target.target_in(ErrorMetric::Rank), + repeating(10_000), + )], &data(), PlanningModels::builtin(), ) @@ -3163,8 +3153,7 @@ mod tests { let root = lower_promql(query, planned.clone()); let run = crate::pass::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], - &[Some(selected.clone())], - &[QueryRecurrence::Unknown.into()], + &[entry_with(selected.clone(), QueryRecurrence::Unknown)], data, models, ) @@ -4019,11 +4008,16 @@ mod tests { const MINUTE: u32 = 60_000; - fn every_minute() -> QueryDemand { - QueryDemand { - recurrence: repeating(MINUTE), + /// The p99 target [`pane_candidates`] are sized for. + fn p99_target() -> AccuracyTarget { + AccuracyTarget::epsilon_delta(0.01, 0.001).with_metric(ErrorMetric::Rank) + } + + /// A predictable p99 query evaluated every minute, with no latency bound. + fn every_minute() -> QueryWorkloadEntry { + QueryWorkloadEntry { predictability: asap_types::workload::Predictability::Predictable { known_at: None }, - max_latency_ms: None, + ..entry_with(p99_target(), repeating(MINUTE)) } } @@ -4044,10 +4038,7 @@ mod tests { /// `rows_per_s`: rebuilt at query time (B2), then maintained at /// ingestion time (B1). fn pane_candidates(rows_per_s: f64) -> Vec { - let root = lower_promql( - "quantile_over_time(0.99, m[5m])", - AccuracyTarget::epsilon_delta(0.01, 0.001).with_metric(ErrorMetric::Rank), - ); + let root = lower_promql("quantile_over_time(0.99, m[5m])", p99_target()); let inventory = crate::per_computation_candidates::generate_per_computation_candidates( vec![(0, QueryRoot::Operator(root))], ) @@ -4159,14 +4150,11 @@ mod tests { assert_eq!((b2.compaction_ms, b1.compaction_ms), (0.0, 0.0)); assert!(b1.query_ms < b2.query_ms, "{b1:?} vs {b2:?}"); let bound = (b1.query_ms + b2.query_ms) / 2.0; - let demand = QueryDemand { - max_latency_ms: Some(bound), - ..every_minute() - }; + let mut bounded = every_minute(); + bounded.requirements.max_latency_ms = Some(bound); let selection = select_plan( &candidates, - &[None], - &[demand], + &[bounded], &arriving(10_000.0), PlanningModels::builtin(), ) diff --git a/crates/asap-aware-mapping/src/test_support.rs b/crates/asap-aware-mapping/src/test_support.rs index 11a91121d..39cc96169 100644 --- a/crates/asap-aware-mapping/src/test_support.rs +++ b/crates/asap-aware-mapping/src/test_support.rs @@ -220,8 +220,10 @@ pub(crate) fn cms_summary(query: &str) -> OperatorNode { let root = lower_promql(query, target.clone()); let run = crate::pass::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], - &[Some(target)], - &[asap_types::workload::QueryRecurrence::Unknown.into()], + &[entry_with( + target, + asap_types::workload::QueryRecurrence::Unknown, + )], &DataWorkload::default(), crate::PlanningModels::builtin(), ) @@ -278,3 +280,27 @@ pub(crate) fn estimate_over( .with_guarantee(Some(guarantee)), ) } + +/// The workload entry of a query evaluated as `recurrence` says, exact and +/// with no latency bound. +pub(crate) fn entry( + recurrence: asap_types::workload::QueryRecurrence, +) -> asap_types::workload::QueryWorkloadEntry { + entry_with(AccuracyTarget::exact(), recurrence) +} + +/// The workload entry of a query with accuracy target `accuracy`, evaluated +/// as `recurrence` says, with no latency bound. +pub(crate) fn entry_with( + accuracy: AccuracyTarget, + recurrence: asap_types::workload::QueryRecurrence, +) -> asap_types::workload::QueryWorkloadEntry { + asap_types::workload::QueryWorkloadEntry { + requirements: QueryRequirements { + accuracy, + max_latency_ms: None, + }, + recurrence, + ..Default::default() + } +} diff --git a/crates/asap-physical-operators/src/physical_planner/candidates.rs b/crates/asap-physical-operators/src/physical_planner/candidates.rs index 1896c8f6d..5eaedf98e 100644 --- a/crates/asap-physical-operators/src/physical_planner/candidates.rs +++ b/crates/asap-physical-operators/src/physical_planner/candidates.rs @@ -376,9 +376,8 @@ mod tests { // ingestion time. let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, planner_types::ir::QueryRoot::Operator(root))], - &[Some(planner_types::types::AccuracyTarget::exact())], - &[planner_types::workload::QueryRecurrence::Unknown.into()], - &workload.data_workload.unwrap(), + &workload.query_workload.entries().collect::>(), + workload.data_workload.as_ref().unwrap(), asap_aware_mapping::PlanningModels::builtin(), ) .unwrap(); diff --git a/crates/asap-physical-operators/tests/common/mod.rs b/crates/asap-physical-operators/tests/common/mod.rs index 17ad94fae..abee99d6e 100644 --- a/crates/asap-physical-operators/tests/common/mod.rs +++ b/crates/asap-physical-operators/tests/common/mod.rs @@ -70,8 +70,13 @@ fn run_stage1_to_stage3( }; asap_aware_mapping::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], - &[Some(accuracy)], - &[planner_types::workload::QueryRecurrence::Unknown.into()], + &[planner_types::workload::QueryWorkloadEntry { + requirements: planner_types::workload::QueryRequirements { + accuracy, + max_latency_ms: None, + }, + ..Default::default() + }], &data, asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/devtools/src/bin/stage_pipeline.rs b/crates/devtools/src/bin/stage_pipeline.rs index 968ee1f36..46509ee71 100644 --- a/crates/devtools/src/bin/stage_pipeline.rs +++ b/crates/devtools/src/bin/stage_pipeline.rs @@ -82,8 +82,8 @@ use asap_types::ir::QueryRoot; use asap_types::pre_asap::schema::{DataType, Field, Schema}; use asap_types::types::{default_metric_for_root, AccuracyTarget, ErrorMetric}; use asap_types::workload::{ - BatchEntry, DataArrival, DataWorkload, DurationMs, PlanningWorkload, Query, QueryDemand, - QueryLanguage, QueryRecurrence, QueryRequirements, QueryWorkload, RepeatedDemand, SqlDialect, + BatchEntry, DataArrival, DataWorkload, DurationMs, PlanningWorkload, Query, QueryLanguage, + QueryRecurrence, QueryRequirements, QueryWorkload, RepeatedDemand, SqlDialect, }; use serde_json::{json, Value}; @@ -251,7 +251,7 @@ fn run(args: Vec) -> Result<(), Failure> { }; let catalog = sql_catalog(&tables)?; let mut names = HashSet::new(); - let (mut described, mut roots, mut demand) = (Vec::new(), Vec::new(), Vec::new()); + let (mut described, mut roots, mut entries) = (Vec::new(), Vec::new(), Vec::new()); for (index, (language, text, name)) in queries.into_iter().enumerate() { let (name, defaulted) = match name { Some(name) => (name, false), @@ -274,27 +274,17 @@ fn run(args: Vec) -> Result<(), Failure> { QueryLanguage::PromQL => lower_promql_roots(&one)?, _ => lower_sql_roots(&one, &catalog)?, }); - demand.extend( - one.query_workload - .entries() - .map(|entry| QueryDemand::from(&entry)), - ); + entries.extend(one.query_workload.entries()); let mut query = workload_queries(&one).remove(0); query["id"] = json!(name); described.push(query); } - let targets = vec![accuracy; roots.len()]; let data = DataWorkload { data_ingestion_interval: declared(DurationMs(interval_ms)), ..Default::default() }; - let result = run_planning_stages_over( - roots.clone(), - &targets, - &demand, - &data, - Some(max_combinations), - ); + let result = + run_planning_stages_over(roots.clone(), &entries, &data, Some(max_combinations)); document_of(described, &roots, result, max_displayed)? } _ => return Err("give exactly one of --example or --promql/--sql queries".into()), diff --git a/crates/devtools/src/planning_stages.rs b/crates/devtools/src/planning_stages.rs index 91b4d0982..daf24bfaf 100644 --- a/crates/devtools/src/planning_stages.rs +++ b/crates/devtools/src/planning_stages.rs @@ -13,8 +13,7 @@ use asap_aware_mapping::stage3_plan_selection::{Selection, SelectionError}; use asap_aware_mapping::PlanningModels; use asap_types::ir::schema_support::with_promql_series_identity; use asap_types::ir::QueryRoot; -use asap_types::types::AccuracyTarget; -use asap_types::workload::{DataWorkload, PlanningWorkload, QueryDemand}; +use asap_types::workload::{DataWorkload, PlanningWorkload, QueryWorkloadEntry}; #[derive(Debug)] pub struct PlanningStagesRun { @@ -142,38 +141,27 @@ pub fn run_planning_stages( roots: Vec, max_combinations: Option, ) -> Result { - let targets: Vec<_> = workload - .query_workload - .entries() - .map(|entry| entry.requirements.accuracy.clone()) - .collect(); - let demand: Vec<_> = workload - .query_workload - .entries() - .map(|entry| QueryDemand::from(&entry)) - .collect(); + let entries: Vec<_> = workload.query_workload.entries().collect(); let data = workload.data_workload.clone().unwrap_or_default(); - run_planning_stages_over(roots, &targets, &demand, &data, max_combinations) + run_planning_stages_over(roots, &entries, &data, max_combinations) } /// [`run_planning_stages`] over roots lowered from any mix of query -/// languages: query `i` is `roots[i]` with accuracy target `targets[i]`, -/// demanded as `demand[i]` says. +/// languages: query `i` is `roots[i]`, with workload entry `entries[i]` +/// (its accuracy target, latency bound, recurrence and predictability). pub fn run_planning_stages_over( roots: Vec, - targets: &[AccuracyTarget], - demand: &[QueryDemand], + entries: &[QueryWorkloadEntry], data: &DataWorkload, max_combinations: Option, ) -> Result { validate(&roots)?; - let targets: Vec<_> = targets.iter().cloned().map(Some).collect(); let per_computation = generate_per_computation_candidates(roots.iter().cloned().enumerate().collect()) .map_err(|e| PlanningStagesError::Pass1(e.to_string()))?; // Count Stage 1 candidates as they are enumerated and stop as soon as // the count passes the limit; never truncate. - let recurrence: Vec<_> = demand.iter().map(|d| d.recurrence.clone()).collect(); + let recurrence: Vec<_> = entries.iter().map(|e| e.recurrence.clone()).collect(); let mut stage1 = Vec::new(); for candidate in stage1_logical_asap_optimization(&per_computation, &recurrence) { if max_combinations.is_some_and(|limit| stage1.len() == limit) { @@ -186,7 +174,7 @@ pub fn run_planning_stages_over( if let Some(limit) = max_combinations { let mut physical = 0usize; for roots in stage1.iter().filter_map(|c| c.roots.as_ref().ok()) { - physical += physical_candidate_count(roots, demand, data).unwrap_or(0); + physical += physical_candidate_count(roots, entries, data).unwrap_or(0); if physical > limit { return Err(PlanningStagesError::TooManyPhysicalCandidates { limit }); } @@ -195,8 +183,7 @@ pub fn run_planning_stages_over( let run = run_stage2_and_stage3( per_computation, stage1, - &targets, - demand, + entries, data, PlanningModels::builtin(), ); diff --git a/crates/frontend-promql/tests/support.rs b/crates/frontend-promql/tests/support.rs index 8108c001d..737dbe087 100644 --- a/crates/frontend-promql/tests/support.rs +++ b/crates/frontend-promql/tests/support.rs @@ -119,8 +119,13 @@ pub fn run_stage1_to_stage3( ) -> asap_aware_mapping::Stage1ToStage3Run { asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(root))], - &[Some(accuracy)], - &[asap_types::workload::QueryRecurrence::Unknown.into()], + &[asap_types::workload::QueryWorkloadEntry { + requirements: asap_types::workload::QueryRequirements { + accuracy, + max_latency_ms: None, + }, + ..Default::default() + }], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) @@ -171,8 +176,13 @@ pub fn logical_candidates( pub fn logical_plan(root: &Rc) -> Result, String> { let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(Rc::clone(root)))], - &[None], - &[asap_types::workload::QueryRecurrence::Unknown.into()], + &[asap_types::workload::QueryWorkloadEntry { + requirements: asap_types::workload::QueryRequirements { + accuracy: asap_types::types::AccuracyTarget::exact(), + max_latency_ms: None, + }, + ..Default::default() + }], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/frontend-sql/tests/pearson_corr.rs b/crates/frontend-sql/tests/pearson_corr.rs index ca569ba85..717096abd 100644 --- a/crates/frontend-sql/tests/pearson_corr.rs +++ b/crates/frontend-sql/tests/pearson_corr.rs @@ -150,8 +150,13 @@ async fn corr_survives_exact_plan_compilation() { let query = lower("SELECT corr(x, y) AS r FROM a").await; let run = asap_aware_mapping::run_stage1_to_stage3( vec![(0, asap_types::ir::QueryRoot::Operator(query.clone()))], - &[Some(asap_types::types::AccuracyTarget::exact())], - &[asap_types::workload::QueryRecurrence::Unknown.into()], + &[asap_types::workload::QueryWorkloadEntry { + requirements: asap_types::workload::QueryRequirements { + accuracy: asap_types::types::AccuracyTarget::exact(), + max_latency_ms: None, + }, + ..Default::default() + }], &Default::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/integration-tests/src/lib.rs b/crates/integration-tests/src/lib.rs index 846a67d46..95c508d80 100644 --- a/crates/integration-tests/src/lib.rs +++ b/crates/integration-tests/src/lib.rs @@ -147,7 +147,7 @@ pub mod post_asap { pub mod planning { use asap_types::ir::{OperatorNode, QueryRoot}; use asap_types::types::AccuracyTarget; - use asap_types::workload::DataWorkload; + use asap_types::workload::{DataWorkload, QueryRequirements, QueryWorkloadEntry}; use std::rc::Rc; /// Every planning stage's output for the single query `root`. @@ -157,8 +157,13 @@ pub mod planning { ) -> asap_aware_mapping::Stage1ToStage3Run { asap_aware_mapping::run_stage1_to_stage3( vec![(0, QueryRoot::Operator(root))], - &[Some(accuracy)], - &[asap_types::workload::QueryRecurrence::Unknown.into()], + &[QueryWorkloadEntry { + requirements: QueryRequirements { + accuracy, + max_latency_ms: None, + }, + ..Default::default() + }], &DataWorkload::default(), asap_aware_mapping::PlanningModels::builtin(), ) diff --git a/crates/integration-tests/tests/planner_layering_example1.rs b/crates/integration-tests/tests/planner_layering_example1.rs index 28fcf291c..8c1361555 100644 --- a/crates/integration-tests/tests/planner_layering_example1.rs +++ b/crates/integration-tests/tests/planner_layering_example1.rs @@ -26,7 +26,6 @@ use asap_types::ir::flat::NodeId; use asap_types::ir::{ASAPOp, NonASAPOp, Operator, QueryRoot, ScalarExpr, SortKey}; use asap_types::post_asap::{FieldDataType, GroupingStrategy, HydraKind, SketchAlgorithm}; use asap_types::post_asap::{Materialization, Medium}; -use asap_types::types::AccuracyTarget; use planner_layering_common::*; // ── Example 1 workload ─────────────────────────────────────────────────── @@ -132,6 +131,14 @@ fn every_10s() -> asap_types::workload::QueryRecurrence { QueryRecurrence::Repeated(RepeatedDemand::FixedInterval(RepetitionInterval(10_000))) } +/// The workload entry of an exact query evaluated every 10 s. +fn exact_every_10s() -> asap_types::workload::QueryWorkloadEntry { + asap_types::workload::QueryWorkloadEntry { + recurrence: every_10s(), + ..Default::default() + } +} + // ── Workload ───────────────────────────────────────────────────────────── /// The encoded workload is valid and normalizes to Q1 then Q2. @@ -728,8 +735,7 @@ fn materialized_case() -> Run { time_range.materialization = Materialization::MatAtQuery(Medium::Memory); let selection = select_plan( std::slice::from_ref(&p.candidate), - &[Some(AccuracyTarget::exact()), Some(AccuracyTarget::exact())], - &[every_10s().into(), every_10s().into()], + &[exact_every_10s(), exact_every_10s()], workload.data_workload.as_ref().unwrap(), PlanningModels::builtin(), ) diff --git a/crates/integration-tests/tests/planner_layering_example2.rs b/crates/integration-tests/tests/planner_layering_example2.rs index b2c73f56e..2e7a0f54d 100644 --- a/crates/integration-tests/tests/planner_layering_example2.rs +++ b/crates/integration-tests/tests/planner_layering_example2.rs @@ -949,18 +949,9 @@ fn stage3_plan_selection_selected_kmv_plan_executes_end_to_end() { .collect(); assert!(!kmv.is_empty(), "a candidate answers Q1 with KMV"); let entries: Vec<_> = workload.query_workload.entries().collect(); - let targets: Vec<_> = entries - .iter() - .map(|e| Some(e.requirements.accuracy.clone())) - .collect(); - let demand: Vec<_> = entries - .iter() - .map(asap_types::workload::QueryDemand::from) - .collect(); let selection = select_plan( &kmv, - &targets, - &demand, + &entries, workload.data_workload.as_ref().unwrap(), PlanningModels::builtin(), ) diff --git a/crates/planner/tests/e2e_plan.rs b/crates/planner/tests/e2e_plan.rs index a78bc7a82..fe6284a02 100644 --- a/crates/planner/tests/e2e_plan.rs +++ b/crates/planner/tests/e2e_plan.rs @@ -138,12 +138,15 @@ async fn facade_plans_match_run_stage1_to_stage3() { targets.push(Some(accuracy)); } let data = workload.data_workload.clone().unwrap(); - let recurrence: Vec<_> = workload - .query_workload - .entries() - .map(|entry| asap_types::workload::QueryDemand::from(&entry)) - .collect(); - let run = run_stage1_to_stage3(roots, &targets, &recurrence, &data, models).unwrap(); + let entries: Vec<_> = workload.query_workload.entries().collect(); + assert_eq!( + entries + .iter() + .map(|e| Some(e.requirements.accuracy.clone())) + .collect::>(), + targets + ); + let run = run_stage1_to_stage3(roots, &entries, &data, models).unwrap(); let selection = run .stage3_plan_selection .as_ref() diff --git a/crates/planner/tests/plan_stages.rs b/crates/planner/tests/plan_stages.rs index bb504278a..56dd774e4 100644 --- a/crates/planner/tests/plan_stages.rs +++ b/crates/planner/tests/plan_stages.rs @@ -40,12 +40,7 @@ fn promql_stages(query: &str, epsilon: f64) -> Stage1ToStage3Run { let roots = lower_promql_query_workload(&workload, NOW_MS).expect("lowers"); run_stage1_to_stage3( roots.into_iter().enumerate().collect(), - &[Some(target)], - &workload - .query_workload - .entries() - .map(|entry| asap_types::workload::QueryDemand::from(&entry)) - .collect::>(), + &workload.query_workload.entries().collect::>(), &workload.data_workload.unwrap(), PlanningModels::builtin(), ) diff --git a/crates/planner/tests/summary_sharing.rs b/crates/planner/tests/summary_sharing.rs index 2773903c1..7e9309e04 100644 --- a/crates/planner/tests/summary_sharing.rs +++ b/crates/planner/tests/summary_sharing.rs @@ -99,18 +99,9 @@ async fn plan_promql(queries: &[(&str, f64)]) -> PlanOutput { fn promql_stages(queries: &[(&str, f64)]) -> Stage1ToStage3Run { let workload = promql_workload(queries); let roots = lower_promql_query_workload(&workload, NOW_MS).expect("lowers"); - let targets: Vec<_> = queries - .iter() - .map(|(query, epsilon)| Some(requested(query, *epsilon))) - .collect(); run_stage1_to_stage3( roots.into_iter().enumerate().collect(), - &targets, - &workload - .query_workload - .entries() - .map(|entry| asap_types::workload::QueryDemand::from(&entry)) - .collect::>(), + &workload.query_workload.entries().collect::>(), &workload.data_workload.clone().unwrap(), PlanningModels::builtin(), ) diff --git a/crates/types/src/workload.rs b/crates/types/src/workload.rs index bd29c45ee..91820d757 100644 --- a/crates/types/src/workload.rs +++ b/crates/types/src/workload.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; // ── Query surface ───────────────────────────────────────────────────────────── /// A raw query string in its source language, before any parsing. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(transparent)] pub struct Query(pub String); @@ -274,7 +274,7 @@ pub enum RepeatedDemand { /// RepeatedDemand::FixedInterval(RepetitionInterval(60_000)), /// ); /// ``` -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "snake_case", deny_unknown_fields)] pub enum QueryRecurrence { OneTime { @@ -282,6 +282,7 @@ pub enum QueryRecurrence { execute_at: Option, }, Repeated(RepeatedDemand), + #[default] Unknown, } @@ -352,7 +353,12 @@ pub struct RepeatingEntry { /// Planner-facing normalized form of either [`BatchEntry`] or /// [`RepeatingEntry`]. It keeps requirements, predictability, recurrence, and -/// event-time selection as separate axes. +/// event-time selection as separate axes. Planning takes one per query, in +/// root order: Stage 2 (physical ASAP-aware optimization) reads the +/// recurrence and predictability, Stage 3 (plan selection) the accuracy +/// target, the latency bound and the recurrence. The default is an empty +/// query, exact, with no latency bound and unknown predictability and +/// recurrence. /// /// # Example /// @@ -373,61 +379,23 @@ pub struct RepeatingEntry { /// }, /// }; /// ``` -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct QueryWorkloadEntry { + /// The query text in the workload's language. pub query: Query, + /// Its accuracy target and latency bound (default: exact, no bound). pub requirements: QueryRequirements, + /// How far ahead it is known: a build may run at ingestion time only for + /// `Predictable` queries (default: unknown). pub predictability: Predictability, + /// How often it runs: sets how often each node is priced, and only + /// repeated queries may keep state from ingestion time (default: unknown). pub recurrence: QueryRecurrence, + /// The event time it reads (default: unknown scope, no lookback). pub time_selection: TimeSelection, } -/// How one query is demanded, as planning reads it: its recurrence, how far -/// ahead it is known, and its response-latency bound. Physical ASAP-aware -/// optimization reads the recurrence and predictability (whether state may -/// be kept from ingestion time); plan selection reads the recurrence (how -/// often each node runs) and the latency bound. -/// -/// # Example -/// -/// ``` -/// use asap_types::workload::{Predictability, QueryDemand, QueryRecurrence}; -/// -/// // Anything not declared: unknown predictability, no latency bound. -/// let demand = QueryDemand::from(QueryRecurrence::Unknown); -/// assert_eq!(demand.predictability, Predictability::Unknown); -/// assert_eq!(demand.max_latency_ms, None); -/// ``` -#[derive(Debug, Clone, PartialEq)] -pub struct QueryDemand { - pub recurrence: QueryRecurrence, - pub predictability: Predictability, - pub max_latency_ms: Option, -} - -impl From<&QueryWorkloadEntry> for QueryDemand { - fn from(entry: &QueryWorkloadEntry) -> Self { - Self { - recurrence: entry.recurrence.clone(), - predictability: entry.predictability.clone(), - max_latency_ms: entry.requirements.max_latency_ms, - } - } -} - -/// A query known only by its recurrence: unknown predictability and no -/// latency bound. -impl From for QueryDemand { - fn from(recurrence: QueryRecurrence) -> Self { - Self { - recurrence, - predictability: Predictability::Unknown, - max_latency_ms: None, - } - } -} - impl From<&BatchEntry> for QueryWorkloadEntry { fn from(entry: &BatchEntry) -> Self { Self { diff --git a/docs/design_docs/proposals/planner-layering-example4-acceptance.md b/docs/design_docs/proposals/planner-layering-example4-acceptance.md index d86107c56..66edad16f 100644 --- a/docs/design_docs/proposals/planner-layering-example4-acceptance.md +++ b/docs/design_docs/proposals/planner-layering-example4-acceptance.md @@ -124,8 +124,9 @@ it. shared EH and its materialization options do not exist yet. 2. **Recurrence input (resolved).** Materialization depends on `recurrence`, `predictability` and `arrival`: `optimize_physical_asap` - takes each entry's `QueryDemand` (recurrence, predictability, latency - bound) and the data workload, and `select_plan` the same demands. + takes the workload entries (`QueryWorkloadEntry`: recurrence, + predictability, accuracy target, latency bound) and the data workload, + and `select_plan` the same entries. 3. **Monthly variant.** The doc does not say whether each monthly run still ends at T or at its own run time, nor give `known_at`. Tests use a repeating entry whose window ends at each run, known at T. From 9a5f58334d4e04e6551dea9c767ae1035d0f3071 Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:59:29 +0000 Subject: [PATCH 6/8] fix: review findings on Stage 2 materialization - Un-ignore the four summary_sharing tests that now pass; the other three are ignored because plan selection still picks an exact plan there. - validate_ingestion_time_summary's doc: the planner checks filtered builds now. - price computes each query's reach once. - Document QueryLatency's fields and CandidateCost::latency. --- .../asap-aware-mapping/src/stage3_plan_selection.rs | 11 ++++++++++- crates/asap-physical-operators/src/capability.rs | 10 +++++----- crates/planner/tests/summary_sharing.rs | 10 +++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/crates/asap-aware-mapping/src/stage3_plan_selection.rs b/crates/asap-aware-mapping/src/stage3_plan_selection.rs index 559b3e220..af1371b52 100644 --- a/crates/asap-aware-mapping/src/stage3_plan_selection.rs +++ b/crates/asap-aware-mapping/src/stage3_plan_selection.rs @@ -192,6 +192,7 @@ pub struct CandidateCost { pub unit: &'static str, pub source: &'static str, pub per_node: BTreeMap, + /// One per query, in workload order: its latency per evaluation. pub latency: Vec, } @@ -200,11 +201,18 @@ pub struct CandidateCost { /// from ingestion time, then the query's own work, each on a full core. #[derive(Debug, Clone, Copy, PartialEq)] pub struct QueryLatency { + /// Milliseconds to merge the ingest workers' partial copies of the + /// newest window of the largest ingestion-time state the query reads; + /// 0 when ingestion fits on one core or the query reads none. pub compaction_ms: f64, + /// Milliseconds of the query-time work the query reaches, each node + /// once. pub query_ms: f64, } impl QueryLatency { + /// `compaction_ms + query_ms`: what is checked against the query's + /// `max_latency_ms`. pub fn total_ms(&self) -> f64 { self.compaction_ms + self.query_ms } @@ -1661,8 +1669,9 @@ fn price( let latency = query_latencies(dag, &nodes, &output, &work_ms, calibration); // A MatAtQuery state is held for one evaluation: from its build until // the longest query reading it finishes, about that query's latency. + let reach = query_reach(dag, &nodes); for (id, (state, per_second)) in held { - let evaluation_ms = query_reach(dag, &nodes) + let evaluation_ms = reach .iter() .zip(&latency) .filter(|(reached, _)| reached.contains(&id)) diff --git a/crates/asap-physical-operators/src/capability.rs b/crates/asap-physical-operators/src/capability.rs index 17d3ad7e5..b17435298 100644 --- a/crates/asap-physical-operators/src/capability.rs +++ b/crates/asap-physical-operators/src/capability.rs @@ -192,11 +192,11 @@ pub(crate) fn hydra_cms_shape( /// build reads raw samples (`$population`, `$timestamp`, `value`), which carry /// none of the query's columns for the filter predicate to read, so only a /// query-time build can apply it. The ingestion-time compiler and the -/// binding of any ingestion-timed `SummaryAgg` apply this check. Planner-side -/// timing validation (materialization timings, Stage 2 eligibility) does not -/// apply it yet: until it gains a check or a `PruneReason`, a plan placing a -/// filtered `SummaryAgg` at ingestion is accepted by the planner and rejected -/// here at compile time. +/// binding of any ingestion-timed `SummaryAgg` apply this check. The planner +/// applies the same rule: Stage 2 never offers `MatAtIngestion` for a +/// filtered build (`IngestionPruneReason::Filtered`), and materialization +/// timing rejects an explicit one (`FilteredSummaryAtIngestion`). This check +/// guards plans that did not come from the planner. pub fn validate_ingestion_time_summary( filter: Option<&planner_types::ir::Predicate>, ) -> Result<(), String> { diff --git a/crates/planner/tests/summary_sharing.rs b/crates/planner/tests/summary_sharing.rs index 7e9309e04..86d926cc8 100644 --- a/crates/planner/tests/summary_sharing.rs +++ b/crates/planner/tests/summary_sharing.rs @@ -209,7 +209,6 @@ fn unique_deployments(output: &PlanOutput) -> usize { /// equal-params subset of summary capability. Both plans hold the same `Rc`, /// so a consumer maintains it once. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] async fn quantiles_with_equal_params_share_one_producer() { let output = plan_promql(&[ ("quantile_over_time(0.5, lat[5m])", 0.01), @@ -224,7 +223,7 @@ async fn quantiles_with_equal_params_share_one_producer() { /// A different window or label selector is a different producer, even when /// one query asks for a stricter accuracy than the other. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] +#[ignore = "plan selection still selects an exact plan for at least one query: with the built-in cost model its query-time summary costs more than exact (#580)"] async fn different_producers_are_not_shared() { for queries in [ [ @@ -288,7 +287,7 @@ fn kll_k_for(epsilon: f64) -> u32 { /// p50 at ε=0.01 and p99 at ε=0.001 over the same input share one KLL sized /// for the strictest consumer; each reader's guarantee meets its own target. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] +#[ignore = "plan selection still selects an exact plan for at least one query: with the built-in cost model its query-time summary costs more than exact (#580)"] async fn quantiles_share_one_producer_sized_for_the_strictest_consumer() { let p50 = ("quantile_over_time(0.5, lat[5m])", 0.01); let p99 = ("quantile_over_time(0.99, lat[5m])", 0.001); @@ -314,7 +313,6 @@ async fn quantiles_share_one_producer_sized_for_the_strictest_consumer() { /// Cross-series quantiles name their KLL state after the input column, not the /// quantile, so p50 and p99 over one selector share it. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] async fn cross_series_p50_and_p99_share_one_producer() { let output = plan_promql(&[("quantile(0.5, lat)", 0.01), ("quantile(0.99, lat)", 0.01)]).await; assert!(same_states(&states(&output))); @@ -324,7 +322,6 @@ async fn cross_series_p50_and_p99_share_one_producer() { /// An ungrouped aggregate has no unique key, so pre-ASAP CSE keeps the two /// copies apart; their identical producers (rate, then sum) are shared here. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] async fn identical_ungrouped_queries_share_their_producers() { let query = ("sum(rate(x[5m]))", 0.01); let output = plan_promql(&[query, query]).await; @@ -335,7 +332,6 @@ async fn identical_ungrouped_queries_share_their_producers() { /// The SQL frontend reaches the same sharing for two copies of one filtered /// percentile. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] async fn identical_sql_percentiles_share_one_producer() { let query = "SELECT approx_percentile_cont(l_extendedprice, 0.5) FROM lineitem WHERE l_orderkey > 10"; @@ -348,7 +344,7 @@ async fn identical_sql_percentiles_share_one_producer() { /// column build one KLL, named after its input, while each query keeps its /// own output column. #[tokio::test] -#[ignore = "plan selection picks the exact plan while summaries run at query time; sharing needs Pass 2 (#580)"] +#[ignore = "plan selection still selects an exact plan for at least one query: with the built-in cost model its query-time summary costs more than exact (#580)"] async fn sql_p50_and_p99_share_one_producer() { let p50 = "SELECT approx_percentile_cont(l_extendedprice, 0.5) FROM lineitem WHERE l_orderkey > 10"; From a38b88e0399886ae4fc1d82eb01920e3464ebaf2 Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 20:09:29 +0000 Subject: [PATCH 7/8] test(integration): reuse_rules reads Stage 2's own MatAtQuery #716's rollup test marked shared nodes MatAtQuery by hand as a stand-in for G8; Stage 2 now offers it for the shared sums, and plan selection picks the rollup unaided. The exact top-k test keeps the stand-in: Stage 2 builds a shared summary once per evaluation, not a shared exact ranking. --- crates/integration-tests/tests/reuse_rules.rs | 61 ++++++++++++------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/crates/integration-tests/tests/reuse_rules.rs b/crates/integration-tests/tests/reuse_rules.rs index 83f7d34d8..e0f71d0cb 100644 --- a/crates/integration-tests/tests/reuse_rules.rs +++ b/crates/integration-tests/tests/reuse_rules.rs @@ -25,7 +25,8 @@ use asap_types::ir::{ use asap_types::post_asap::Schema; use asap_types::types::AccuracyTarget; use asap_types::workload::{ - DataArrival, DataWorkload, QueryRecurrence, RepeatedDemand, RepetitionInterval, + DataArrival, DataWorkload, QueryRecurrence, QueryWorkloadEntry, RepeatedDemand, + RepetitionInterval, }; const EVALUATION_MS: i64 = 300_000; @@ -43,14 +44,21 @@ fn plan(queries: &[&str], recurrence: QueryRecurrence) -> Stage1ToStage3Run QueryWorkloadEntry { + QueryWorkloadEntry { + recurrence, + ..Default::default() + } +} + /// The #509 shared data workload: 1,000,000 series sampled every 15 s. fn data() -> DataWorkload { shared_data_workload(DataArrival::ContinuouslyIngesting) @@ -176,10 +184,11 @@ fn nested_sum_merge_is_selected_and_answers_as_the_nested_sums() { assert_eq!(answer, execute(&nested)); } -/// A stand-in for Stage 2 materialization (G8): the highest computed nodes +/// A stand-in for materialization Stage 2 does not offer: Stage 2 builds a +/// shared summary once per evaluation (`MatAtQuery`), but not a shared exact +/// computation such as a top-k ranking. Here the highest computed nodes /// (not a raw scan or time range) that more than one query reads are -/// computed once per evaluation (`MatAtQuery`). Returns what the selected candidate -/// reuses. +/// computed once per evaluation. Returns what the selected candidate reuses. fn materialize_shared(run: &Stage1ToStage3Run) -> Vec { let mut candidates = run.stage2_physical_asap_optimization.clone(); for candidate in &mut candidates { @@ -231,8 +240,7 @@ fn materialize_shared(run: &Stage1ToStage3Run) -> Vec { let queries = run.stage1_pass1_per_computation.roots.len(); let selection = select_plan( &candidates, - &vec![None; queries], - &vec![repeating(); queries], + &vec![exact(repeating()); queries], &data(), PlanningModels::builtin(), ) @@ -249,22 +257,28 @@ fn materialize_shared(run: &Stage1ToStage3Run) -> Vec { } /// The reuse candidates of `queries`, and what the selected candidate -/// reuses when every shared computed node is computed once. +/// reuses. Stage 2 offers each computation two queries read built once per +/// evaluation (`MatAtQuery`); the selected reuse candidate takes it. fn selected_reuse(queries: &[&str]) -> Vec { let run = plan(queries, repeating()); assert!(run.stage2_pruned.is_empty(), "{:?}", run.stage2_pruned); - let reused: Vec<_> = run - .stage1_pass2 - .iter() - .filter(|p| !p.reused.is_empty()) - .collect(); - assert!(!reused.is_empty(), "{queries:?}"); + assert!( + run.stage1_pass2.iter().any(|p| !p.reused.is_empty()), + "{queries:?}" + ); let selected = run.selected().unwrap(); assert!( - !reused.iter().any(|p| p.id == selected.from_logical), - "{queries:?}: not cheaper while every query recomputes what it reads" + selected + .materialization + .values() + .any(|m| matches!(m, Materialization::MatAtQuery(_))), + "{queries:?}: {} computes its shared state once", + selected.id ); - materialize_shared(&run) + run.stage1_pass2 + .iter() + .find(|p| p.id == selected.from_logical) + .map_or_else(Vec::new, |p| p.reused.clone()) } /// `sum by (job)` beside `sum by (job, instance)`: with the finer sums @@ -283,10 +297,13 @@ fn rollup_is_selected_when_the_finer_sums_are_computed_once() { #[test] fn exact_topk_reuse_is_selected_when_the_ranking_is_computed_once() { assert_eq!( - selected_reuse(&[ - "topk by (job) (5, rate(m[1m]))", - "topk by (job) (10, rate(m[1m]))", - ]), + materialize_shared(&plan( + &[ + "topk by (job) (5, rate(m[1m]))", + "topk by (job) (10, rate(m[1m]))", + ], + repeating(), + )), ["top-k for Q1, Q2 from one top-10"] ); } From 0723f054b8bc1125f5ce916461f4f4d83962846a Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 15 Oct 2026 20:14:26 +0000 Subject: [PATCH 8/8] docs(planner): SelectionError::EntryCount says it is bad input --- crates/asap-aware-mapping/src/stage3_plan_selection.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/asap-aware-mapping/src/stage3_plan_selection.rs b/crates/asap-aware-mapping/src/stage3_plan_selection.rs index af1371b52..8067a5824 100644 --- a/crates/asap-aware-mapping/src/stage3_plan_selection.rs +++ b/crates/asap-aware-mapping/src/stage3_plan_selection.rs @@ -316,6 +316,8 @@ pub struct Selection { #[derive(Debug, Error)] pub enum SelectionError { + /// Bad input: the caller gave a different number of workload entries + /// than the candidate has query roots. #[error("candidate {candidate} has {roots} roots but {entries} workload entries were given")] EntryCount { candidate: String,