Skip to content

Add tests documenting aggregate strategy across join_many legs - #2873

Open
aszenz wants to merge 1 commit into
malloydata:mainfrom
aszenz:add-fanout-symagg-tests
Open

Add tests documenting aggregate strategy across join_many legs#2873
aszenz wants to merge 1 commit into
malloydata:mainfrom
aszenz:add-fanout-symagg-tests

Conversation

@aszenz

@aszenz aszenz commented Jun 10, 2026

Copy link
Copy Markdown

Repro tests for #2872.

Documents when the compiler switches between plain and symmetric aggregates across join_many legs, on the synthetic shape from the issue (1,000 parents × two 30-row legs, expected totals 465,000):

  • one fanning leg referenced → plain SUM
  • two fanning legs in one stage → cross fan-out, symmetric aggregates (the slow path on MySQL/Postgres described in the issue)
  • legs pre-aggregated to parent grain via join_one → plain SUMs

Tests run against in-repo DuckDB only (the strategy choice is dialect-independent; only its cost differs), so they're cheap and assert both the SQL shape and the correct totals.

Pins when the compiler switches from plain aggregates to symmetric
aggregates: one fanning leg stays plain, two legs in a stage fan out and
go symmetric, pre-aggregated join_one legs stay plain. Baseline for the
performance problem described in malloydata#2872.

Signed-off-by: asrar <aszenz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant