MCPcopy Create free account
hub / github.com/apache/cloudberry / cdbpath_create_explicit_motion_path

Function cdbpath_create_explicit_motion_path

src/backend/cdb/cdbpath.c:668–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666} /* cdbpath_create_motion_path */
667
668Path *
669cdbpath_create_explicit_motion_path(PlannerInfo *root,
670 Path *subpath,
671 CdbPathLocus locus)
672{
673 CdbMotionPath *pathnode;
674
675 /* Create CdbMotionPath node. */
676 pathnode = makeNode(CdbMotionPath);
677 pathnode->path.pathtype = T_Motion;
678 pathnode->path.parent = subpath->parent;
679 /* Motion doesn't project, so use source path's pathtarget */
680 pathnode->path.pathtarget = subpath->pathtarget;
681 pathnode->path.locus = locus;
682 pathnode->path.rows = subpath->rows;
683 pathnode->path.pathkeys = NIL;
684
685 /* GPDB_96_MERGE_FIXME: When is a Motion path parallel-safe? I tried
686 * setting this to 'false' initially, to play it safe, but somehow
687 * the Paths with motions ended up in gather plans anyway, and tripped
688 * assertion failures.
689 */
690 pathnode->path.parallel_aware = false;
691 pathnode->path.parallel_safe = false;
692 pathnode->path.parallel_workers = subpath->parallel_workers;
693
694 pathnode->subpath = subpath;
695 pathnode->is_explicit_motion = true;
696
697 /* Cost of motion */
698 cdbpath_cost_motion(root, pathnode);
699
700 /* Tell operators above us that slack may be needed for deadlock safety. */
701 pathnode->path.motionHazard = true;
702 pathnode->path.barrierHazard = false;
703 pathnode->path.rescannable = false;
704
705 return (Path *) pathnode;
706}
707
708Path *
709cdbpath_create_broadcast_motion_path(PlannerInfo *root,

Callers 2

create_split_update_pathFunction · 0.85

Calls 1

cdbpath_cost_motionFunction · 0.85

Tested by

no test coverage detected