morrySnow commented on code in PR #64793:
URL: https://github.com/apache/doris/pull/64793#discussion_r3479092689


##########
fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java:
##########
@@ -257,6 +257,29 @@ public boolean isFinalized() {
         return finalized;
     }
 
+    /**
+     * DFS from {@code node} down to {@code target} within the fragment 
(stopping at
+     * ExchangeNode boundaries). Returns null if target is not under node, 
otherwise
+     * whether the path crosses a LocalExchangeNode.
+     */

Review Comment:
   🟢 **Minor: Consider memoization for `pathCrossesLocalExchange`**: This DFS 
runs per local RF target in `toThrift()`. In a fragment with N targets under 
the same builder join, the subtree from the builder is walked N times. For deep 
plan trees with many RF targets, this could be O(N × depth). Since the plan is 
immutable at this point, consider pre-computing which targets have an LE on the 
path (e.g., a single BFS from the builder node, or caching the Boolean per 
target node). Not a correctness issue, just a potential optimization.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to