Skip to content

feat(promql): retain summary leaves under binary arithmetic plans #343

Description

@zzylol

Audit evidence

ASAPQuery PRs #256, #572, #577, and #644 accelerate arithmetic trees over supported PromQL leaves. ASAPPlanner lowers the syntax, but current physical selection returns no legal summary candidate for both rate(a[1m]) + rate(b[1m]) and rate(a[1m]) / 2. The binary root therefore hides otherwise-realizable leaves.

Required behavior

  • Add a post-ASAP representation for exact arithmetic over independently realized summary/readout children.
  • Cover all six ASAPQuery operators: + - * / % ^.
  • Preserve vector/vector label matching for the ASAPQuery-supported default case and both scalar operand orderings.
  • Keep whole-query exact fallback when either arm cannot be accelerated; do not partially answer from mismatched snapshots.
  • Keep vector-matching modifiers out of scope, matching ASAPQuery.

Acceptance tests

Planner E2E/candidate tests cover instant/range-shaped workloads, nested arithmetic, vector/vector, scalar/vector, vector/scalar, empty arms, and an unsupported-arm fallback. Link backend execution work to ProjectASAP/ASAPQuery-backend#501.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestirPre-ASAP or post-ASAP intermediate representationoptimizerWorkload optimization and plan selectionpromqlPromQL front-end lowering (L1→L2)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions