jiaqizho commented on code in PR #1219: URL: https://github.com/apache/cloudberry/pull/1219#discussion_r2206128278
########## 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: How we make sure already have the broadcast motion in the subpath ?or when we added motion if current target table distributed by replicate? -- 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: commits-unsubscr...@cloudberry.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For additional commands, e-mail: commits-h...@cloudberry.apache.org