Environment
- Tool:
control_plane --example inspect_physical_dag (normal BackendLocalPlanningSnapshot::compile path)
- Snapshots: version 1, derived from
docs/examples/asapquery-compatibility-demo-snapshot.json;
source_sample_interval_ms = 1000, horizon_seconds = 3600, no window_candidates supplied.
Quantile/topk queries use EpsilonDelta { epsilon: 0.01, delta: 0.01 }; sum/count/min/max use implicit_exact.
Workloads
Metric data, scraped every 1s.
| id |
queries |
repeats every |
range |
| w1 |
10 × quantile_over_time(φ, data[15m]), φ ∈ {0.5 … 0.999} |
1m |
15m |
| w2 |
1 × quantile_over_time(0.9, data[5m]) |
30s |
5m |
| w3 |
5 × quantile by (job) (φ, data) |
1s |
instant (lookback 1s) |
| w4 |
5 × quantile_over_time(φ, data[5m]) + 5 × quantile by (job) (φ, data) |
10s / 1s |
5m / instant |
| w5 |
1 × quantile_over_time(0.9, data[5m]) / quantile_over_time(0.5, data[5m]) |
1m |
5m |
| w6 |
sum_over_time, count_over_time, min_over_time, max_over_time of data[5m]; topk(5, sum_over_time(data[5m])), topk(5, count_over_time(data[5m])) |
30s |
5m |
Installed materialized state
From install_request.precompute_plan.materializations:
| id |
sketch |
grouping |
window type |
size |
slide |
layout |
| w1 |
DDSketch α=0.01 |
none (per entity) |
tumbling |
900s |
900s |
pane 900s |
| w2 |
DDSketch α=0.01 |
none (per entity) |
tumbling |
300s |
300s |
pane 300s |
| w3 |
DDSketch α=0.01 |
job |
tumbling |
1s |
1s |
pane 1s |
| w4 |
DDSketch α=0.01 |
job |
tumbling |
1s |
1s |
pane 1s |
|
DDSketch α=0.01 |
none (per entity) |
tumbling |
300s |
300s |
pane 300s |
| w5 |
— (no materialization; QueryPlan is a single exact_fallback) |
|
|
|
|
|
| w6* |
Sum (serves sum_over_time and count_over_time) |
none (per entity) |
tumbling |
300s |
300s |
pane 300s |
|
MinMax (serves max_over_time) |
none (per entity) |
tumbling |
300s |
300s |
pane 300s |
|
CountSketchWithHeap d=5 w=512 heap=5 (topk of sum) |
grouped |
tumbling |
300s |
300s |
pane 300s |
|
CountMinSketchWithHeap d=5 w=512 heap=5 (topk of count) |
grouped |
tumbling |
300s |
300s |
pane 300s |
* w6 with min_over_time removed; see below.
Multiple queries on one population share state as expected (w1: 10 queries → 1 materialization; w4: 10 → 2).
Bug 1: min_over_time does not compile
w6 fails, and min_over_time(data[5m]) fails on its own:
Error: QueryPlan(Invalid("materialized query has no compiled executable DAG"))
max_over_time(data[5m]) in the same snapshot compiles to a MinMax materialization. The other five
w6 queries compile together once min_over_time is removed.
Bug 2 (suspected): window slide ignores query evaluation interval
Every materialization is tumbling with slide = size = query range, even when the query repeats much
more often than its range:
- w1: 15m range evaluated every 1m → one 900s tumbling pane
- w2: 5m range every 30s, w4: 5m range every 10s → one 300s tumbling pane
A 900s tumbling pane covers (t-15m, t] only at 15-minute boundaries. Expected either a sliding
window whose pane width divides the 60s evaluation interval, or a compile-time rejection/exact routing.
Runtime behaviour at non-aligned evaluation times (stale answer vs. exact fallback) is not yet verified.
Observation: w5 routes the quantile ratio to exact execution
logical_selection shows Planner selected a DDSketch summary for each
quantile operand, but rejected the division root:
composed guarantee (AbsoluteValue, bound None, failure probability None) does not satisfy EpsilonDelta { epsilon: 0.01, delta: 0.01 }
Question: is exact routing the intended outcome for a ratio of two ε-approximate quantiles over the same
range, or should the operands be served from one shared DDSketch?
Environment
control_plane --example inspect_physical_dag(normalBackendLocalPlanningSnapshot::compilepath)docs/examples/asapquery-compatibility-demo-snapshot.json;source_sample_interval_ms = 1000,horizon_seconds = 3600, nowindow_candidatessupplied.Quantile/topk queries use
EpsilonDelta { epsilon: 0.01, delta: 0.01 }; sum/count/min/max useimplicit_exact.Workloads
Metric
data, scraped every 1s.quantile_over_time(φ, data[15m]), φ ∈ {0.5 … 0.999}quantile_over_time(0.9, data[5m])quantile by (job) (φ, data)quantile_over_time(φ, data[5m])+ 5 ×quantile by (job) (φ, data)quantile_over_time(0.9, data[5m]) / quantile_over_time(0.5, data[5m])sum_over_time,count_over_time,min_over_time,max_over_timeofdata[5m];topk(5, sum_over_time(data[5m])),topk(5, count_over_time(data[5m]))Installed materialized state
From
install_request.precompute_plan.materializations:jobjobexact_fallback)* w6 with
min_over_timeremoved; see below.Multiple queries on one population share state as expected (w1: 10 queries → 1 materialization; w4: 10 → 2).
Bug 1:
min_over_timedoes not compilew6 fails, and
min_over_time(data[5m])fails on its own:max_over_time(data[5m])in the same snapshot compiles to a MinMax materialization. The other fivew6 queries compile together once
min_over_timeis removed.Bug 2 (suspected): window slide ignores query evaluation interval
Every materialization is tumbling with slide = size = query range, even when the query repeats much
more often than its range:
A 900s tumbling pane covers
(t-15m, t]only at 15-minute boundaries. Expected either a slidingwindow whose pane width divides the 60s evaluation interval, or a compile-time rejection/exact routing.
Runtime behaviour at non-aligned evaluation times (stale answer vs. exact fallback) is not yet verified.
Observation: w5 routes the quantile ratio to exact execution
logical_selectionshows Planner selected a DDSketch summary for eachquantile operand, but rejected the division root:
Question: is exact routing the intended outcome for a ratio of two ε-approximate quantiles over the same
range, or should the operands be served from one shared DDSketch?