Skip to content

Commit efa27b5

Browse files
adriangbclaude
andcommitted
feat: report the ordering and partitioning of materialized CTE scans (GREEN)
optimize_physical_plan now optimizes each MATERIALIZED CTE body one time, on its own, as the child of a MaterializedCteExec, after the bodies that it reads or defines. Each scan then gets the statistics, the partition count, the output ordering and the hash partitioning of its optimized body. While the rest of the plan is optimized, each MaterializedCteExec is replaced by a planning-only node whose only child is the continuation, so the optimizers cannot change the body and the properties of the scans stay correct. Closes apache#26424. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 961a5c9 commit efa27b5

1 file changed

Lines changed: 522 additions & 106 deletions

File tree

0 commit comments

Comments
 (0)