github-actions[bot] commented on code in PR #62165:
URL: https://github.com/apache/doris/pull/62165#discussion_r3054887822


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java:
##########
@@ -281,12 +281,12 @@ private boolean isBucketShuffleDownGrade(Plan 
oneSidePlan) {
         if (!isEnableBucketShuffleJoin) {
             return true;
         } else if (!(oneSidePlan instanceof GroupPlan)) {
-            return false;
+            return true;
         } else {
             PhysicalOlapScan candidate = 
findDownGradeBucketShuffleCandidate((GroupPlan) oneSidePlan);
             if (candidate == null || candidate.getTable() == null
                     || candidate.getTable().getDefaultDistributionInfo() == 
null) {

Review Comment:
   `candidate == null` does not necessarily mean bucket shuffle is invalid 
here. `findDownGradeBucketShuffleCandidate()` only unwraps `Project` and 
`Filter`, but `ChildOutputPropertyDeriver.visitPhysicalLimit()` and 
`visitAbstractPhysicalSort()` both preserve the child's hash distribution. That 
means a real memoized join child like `Limit/LocalTopN(OlapScan)` can still 
have a valid `NATURAL` bucketed property; after this change it always falls 
into `candidate == null` and gets downgraded to `EXECUTION_BUCKETED`, even when 
the table has enough buckets. This turns valid bucket-shuffle plans into normal 
shuffle joins and regresses performance.



-- 
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