Skip to content

planner/optimizer: decide support for multi-statistic AQEs (e.g. avg) #419

Closed

Description

@milindsrivastava1997

planner/optimizer — `candidate_gen.rs::enumerate_candidates` currently falls back to EXACT-only whenever an AQE needs more than one statistic (`aqe.requirements.statistics.len() != 1`), e.g. `avg` which decomposes to `[Sum, Count]`. This is marked with a `// ponytail:` comment as "not supported in v1."

Need to decide: should multi-statistic AQEs be supported by pairing two sketches (one per statistic), and if so, what does candidate generation / cost modeling / query method assignment look like for a pair instead of a single sketch? If staying EXACT-only for now is fine, this issue tracks that as a known gap rather than a silent limitation.

Found during code review of PR #407.

Activity

  1. milindsrivastava1997 commented on Oct 4, 2026

    @milindsrivastava1997
    ContributorAuthor

    Decision (from #753 scoping): for the optimizer, rewrite multi-statistic AQEs such as avg into separate sum and count AQEs (divide at query time) instead of falling back to EXACT. EXACT is being removed from the optimizer (#759). Engine-side Avg support is #463.

    🤖 Generated with Claude Code

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

    asap-plannerenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions