Skip to content

asap-aware-mapping: group-by-lattice roll-up reuse (fine-to-coarse) as a ReplacementStrategy #254

Description

@zzylol

Part of #33.

What

A ReplacementStrategy detecting the catalog's "Roll-ups" primitive plus Peilin's "CSE across aggregations, and group by key management": when two Aggregate nodes share the same source subtree (same Rc child, post-CSE) with mergeable intents (agg_is_mergeable) and one's by set is a superset of the other's, the coarser aggregate can be produced by re-aggregating the finer one's output instead of an independent pass over the shared source.

Design

  • Only fires for agg_is_mergeable intents (Sum/Count/MinMax/Rate/Increase) — Avg/StdDev/Variance need the semantic-rewrite sub-issue's decomposition first, which the search composes automatically once both strategies are registered.
  • Legality reuses Schema::unique_keys the same way CSE's own sharing gate does — no new legality machinery, just a new matching relation (subset-of, not equality-of) layered on top.
  • ColumnId comparability across the two Aggregate nodes is only sound because they share the literal same child Rc (guaranteed identical positional numbering) — extending this to two structurally-different-but-equivalent sources is explicitly out of scope here.
  • Interacts with the GroupingStrategy/Hydra sub-issue: whether a SharedMultiSubpopulation structure can serve as the "finer" side of a roll-up depends on whether that summary family supports merging down to a coarser grouping — this issue should land the legality predicate as an explicit, testable function so that sub-issue can call it rather than assuming all combinations are valid.

Non-goal

Actually materializing a roll-up operator (a pre-aggregated Source/Scan leaf) at execution time is separate, larger work outside asap-aware-mapping's scope — this issue only needs the search to be able to construct the ReplacementSubDAG at the pre-ASAP level (child = the other aggregate's node instead of the raw scan).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions