avamingli commented on code in PR #1219:
URL: https://github.com/apache/cloudberry/pull/1219#discussion_r2206134512


##########
src/backend/cdb/cdbpath.c:
##########
@@ -2622,7 +2622,15 @@ create_motion_path_for_insert(PlannerInfo *root, 
GpPolicy *policy,
                        }
 
                }
-               subpath = cdbpath_create_broadcast_motion_path(root, subpath, 
policy->numsegments);
+
+               /*
+                * planner may have add a top Motion eariler.
+                * Create table t1(id int) distributed randomly;
+                * Create table t2 as select random() from t1 distributed 
replicated;
+                * Avoid Motion if there was already one.
+                */
+               if (!CdbPathLocus_IsReplicated(subpath->locus))

Review Comment:
   Replicated is a Broadcast Motion. 



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