Add support for CTE operators - #19
Conversation
|
So I ran the query and I see our operators are still missing from the plan. The join edges for the CTE tables are missing and the optimizer skips over DAG creation since no. of edges is under 2. |
|
If the query you refer to is q15, I think it actually contains only one join on |
|
The query has two hash joins:
we may not see improvements for this query since the aggregate emits just one row, but this could be beneficial for queries with group bys. |
|
You're right, there are actually two hash joins but only one join edge extracted. After tracing the second join that is not turned into join edge, I found that the right child contains ungrouped aggregate, so the binding can not be mapped to cte scan in our current code. However, the binding tracing can go across grouped aggregates, which means join edges can be extracted if the aggregate here is group by. |
|
okay that's good, then. Thanks! |
Materialized CTE operators do not require special handling because the default case recursively visits their children. However, CTE references were not registered in the transfer DAG.
This PR registers CTE references as separate transfer DAG nodes.