Instant and range query handling in promql.rs are hand-cloned rather than shared:
handle_binary_expr_promql (line 381) vs handle_binary_expr_range_promql (line 535): identical scalar-vs-vector arm detection.
build_arm_logical_plan (line 346) vs build_arm_range_context (line 462): identical recursive Paren-unwrap + structural config lookup.
handle_query_promql / handle_range_query_promql both re-parse the query string just to check for a binary expression, and the context builders they call parse the same string again — the AST gets parsed 2-3x per query.
Instant and range query handling in promql.rs are hand-cloned rather than shared:
handle_binary_expr_promql(line 381) vshandle_binary_expr_range_promql(line 535): identical scalar-vs-vector arm detection.build_arm_logical_plan(line 346) vsbuild_arm_range_context(line 462): identical recursiveParen-unwrap + structural config lookup.handle_query_promql/handle_range_query_promqlboth re-parse the query string just to check for a binary expression, and the context builders they call parse the same string again — the AST gets parsed 2-3x per query.