Repository navigation
Refactor: share the traversal of ActionsDAG nodes between its walks - #129671
Conversation
Add `src/Interpreters/ActionsDAGTraversal.h`: `visitReachableNodes`, `anyReachableNode`, `allReachableNodes`, `visitNodesPostOrder`, `computeForNodes`, and `findReachableNodes` (moved from actionsDAGUtils unchanged). Each visits a node at most once. Rewrite the hand-written walks over `Node::children` in ActionsDAG.cpp, FilterStep, filterPushDown, optimizeJoin and VirtualColumnUtils on top of them. Results, output order, errors and hash values are unchanged. Walks that rewrite children mid-walk, keep per-node state or depend on visit order stay as they are.
|
Workflow [PR], commit [63e4ffc] Summary: ✅
AI ReviewSummaryThis PR consolidates traversal of Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; remaining CI should complete before merge. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes8 object files changed (-23.02 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units30 translation units recompiled, 252 s compile time in total, 30 of them have a recent master baseline. Median compile-time ratio to the baselines is ×0.94 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
novikd
left a comment
There was a problem hiding this comment.
LGTM, but it would be nice to avoid traversing the same DAG several times
indexHint keep HAVING above GROUPING SETS
#131336
Cherry pick #129671 to 26.10: Refactor: share the traversal of ActionsDAG nodes between its walks
…G nodes between its walks
The function is not on 26.10; #129671 only rewrote its body on master. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #129671 to 26.10: Refactor: share the traversal of ActionsDAG nodes between its walks
Related: #129184
A refactor of the walks over
ActionsDAG::Node::children. A node of anActionsDAGcan have several parents, and each walk re-implemented "visit every node once" by hand.Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129671]
Version info
26.11.1.1819-master(included in26.11and later)26.10.7.23