You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add optimizer aggregation families and capability/SLA metadata #762
Expand promql_utilities::AggregationType and establish one aggregation-capability descriptor for optimizer-facing behavior. The descriptor must be the single source for: query statistic support, exact versus approximate accuracy, benchmark accuracy metric, and comparison direction. Eligibility consumes this descriptor instead of maintaining a separate type match.
Target capability mapping:
sum and count: MultipleSum
top-k: existing CountMinSketchWithHeap and sketchlib CSHeap (CountSketch with heap)
increase: MultipleIncrease
min and max: MultipleMinMax
quantile: KLL, DDSketch, and HydraKLL
Add DDSketch, CountSketch, CountSketchWithHeap/CSHeap, and UnivMon aggregation types where appropriate. CSHeap is the concrete name used by asap_sketchlib; choose an ASAPQuery enum spelling that is clear and map it explicitly to that implementation.
SLA metadata
For every approximate family that is eligible under accuracy_sla, define the benchmark metric and whether lower or higher is better. Error metrics use actual_error <= 1 - accuracy_sla; recall metrics use actual_recall >= accuracy_sla. Exact families bypass the accuracy measurement. Missing or malformed measurements make an approximate candidate ineligible.
In particular, do not use CMS relative_error_mean as an accuracy SLA metric unless its semantics and scale are validated. The benchmark output has values far above [0, 1] because rare-key long-tail errors dominate. If Count-Min Sketch is limited to heavy-hitter/top-k serving, use an appropriate bounded top-k quality metric such as recall instead.
Delivery boundary
This issue may introduce types and optimizer metadata before runtime support exists. The engine must return an explicit unsupported-aggregation-type error for any type it cannot execute. Such candidates must be excluded by default and considered only with --milp-allow-unsupported-sketches.
changed the title [-]Add DDSketch, CountSketch(+heap), UnivMon to AggregationType (engine-unsupported, optimizer-only)[/-][+]Add optimizer aggregation families and capability/SLA metadata[/+]on Oct 5, 2026
Decision: add compatible_agg_types_for_planner(stat) alongside the existing compatible_agg_types(stat).
compatible_agg_types remains the deployable runtime contract: it returns only aggregation types that the data plane and query engine can execute. compatible_agg_types_for_planner is the optimizer-facing vocabulary: it may additionally return the experimental types introduced here (DDSketch, CountSketch, CSHeap, UnivMon) so the planner can cost and evaluate them before #787 implements their runtime paths.
Candidate generation selects the planner-specific helper only when --milp-allow-unsupported-sketches is enabled; otherwise it uses the deployable helper. This preserves the small runtime interface while allowing the optimizer work to proceed independently of data-plane support.
Activity
[-]Add DDSketch, CountSketch(+heap), UnivMon to AggregationType (engine-unsupported, optimizer-only)[/-][+]Add optimizer aggregation families and capability/SLA metadata[/+]milindsrivastava1997 commentedon Oct 5, 2026
Decision: add
compatible_agg_types_for_planner(stat)alongside the existingcompatible_agg_types(stat).compatible_agg_typesremains the deployable runtime contract: it returns only aggregation types that the data plane and query engine can execute.compatible_agg_types_for_planneris the optimizer-facing vocabulary: it may additionally return the experimental types introduced here (DDSketch,CountSketch,CSHeap,UnivMon) so the planner can cost and evaluate them before #787 implements their runtime paths.Candidate generation selects the planner-specific helper only when
--milp-allow-unsupported-sketchesis enabled; otherwise it uses the deployable helper. This preserves the small runtime interface while allowing the optimizer work to proceed independently of data-plane support.milindsrivastava1997 commentedon Oct 28, 2026
Taken care of by rqe-optimizer