Skip to content

Add DP join reordering, statistics propagation, and column pruning#7

Merged
whilo merged 1 commit intomainfrom
feature/optimizer-passes
Apr 5, 2026
Merged

Add DP join reordering, statistics propagation, and column pruning#7
whilo merged 1 commit intomainfrom
feature/optimizer-passes

Conversation

@whilo
Copy link
Copy Markdown
Member

@whilo whilo commented Apr 5, 2026

Summary

  • DP join reordering: Dynamic programming over bitmask subsets finds optimal dimension join ordering for multi-join queries. Minimizes total probe cost (sum of rows entering each join step). Respects column dependencies for snowflake schemas via compute-join-deps.
  • Statistics propagation: Bottom-up propagation of estimated row counts through physical plan tree nodes (scans, filters, joins, aggregates). Enables downstream passes to make cost-informed decisions.
  • Column pruning: Global collection of all referenced column keywords, then select-keys on scan nodes to remove unreferenced columns. Reduces memory and compute for wide tables.

All three passes integrate into the existing optimize pipeline after predicate-pushdown and before operator-fusion.

Test plan

  • All 811 stratum tests pass (0 failures, 0 errors)
  • Snowflake schema dependency tracking verified (multi-level-pushdown test)
  • Join reorder respects column dependencies between chained dims

… query planner

Three new optimization passes:
- Join reorder: DP over bitmask subsets to find optimal dimension join
  ordering. Minimizes total probe cost respecting snowflake schema
  column dependencies between dims.
- Statistics propagation: bottom-up estimated row counts through
  physical plan tree (scans, filters, joins, aggregates).
- Column pruning: collect all referenced column keywords globally,
  then select-keys on scan nodes to remove unreferenced columns.
@whilo whilo merged commit e571c16 into main Apr 5, 2026
5 of 6 checks passed
@whilo whilo deleted the feature/optimizer-passes branch April 5, 2026 07:18
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