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
Share the full PromQL pattern list between planner and engine #855
The planner and the query engine must accept the same PromQL shapes. #849 moved the collapsable ONE_TEMPORAL_ONE_SPATIAL and TOPK_OF_SUM builders into promql_utilities::ast_matching::collapsable_patterns. The ONLY_TEMPORAL and ONLY_SPATIAL patterns are still built separately:
Engine:asap-query-engine/src/engines/simple_engine/mod.rs, from temporal_pattern_blocks / spatial_pattern_blocks.
So those two lists, and the order the patterns are tried in, can still drift apart.
Fix direction
Move the whole ordered build_patterns() into promql_utilities and call it from both sides. The engine builds its two patterns from a block map, so check that the shared builder yields the same pattern set, e.g. by comparing match results across a corpus of queries before deleting the engine copy.
Related: wasted heaps for topk by (l) (k, sum by (l) (...))
When topk's bucket labels cover all of the inner sum's labels, each bucket holds exactly one series. The query returns every group, yet the planner allocates a CMS plus a heap per bucket value. This is a degenerate shape and low priority; when needed, plan it as an exact sum by (l) instead (planner/labels.rs).
Activity