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

Function create_gather_path

src/backend/optimizer/util/pathnode.c:3003–3036  ·  view source on GitHub ↗

* create_gather_path * Creates a path corresponding to a gather scan, returning the * pathnode. * * 'rows' may optionally be set to override row estimates from other sources. */

Source from the content-addressed store, hash-verified

3001 * 'rows' may optionally be set to override row estimates from other sources.
3002 */
3003GatherPath *
3004create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
3005 PathTarget *target, Relids required_outer, double *rows)
3006{
3007 Assert(false);
3008 GatherPath *pathnode = makeNode(GatherPath);
3009
3010 Assert(subpath->parallel_safe);
3011
3012 pathnode->path.pathtype = T_Gather;
3013 pathnode->path.parent = rel;
3014 pathnode->path.pathtarget = target;
3015 pathnode->path.param_info = get_baserel_parampathinfo(root, rel,
3016 required_outer);
3017 pathnode->path.parallel_aware = false;
3018 pathnode->path.parallel_safe = false;
3019 pathnode->path.parallel_workers = 0;
3020 pathnode->path.pathkeys = NIL; /* Gather has unordered result */
3021
3022 pathnode->subpath = subpath;
3023 pathnode->num_workers = subpath->parallel_workers;
3024 pathnode->single_copy = false;
3025
3026 if (pathnode->num_workers == 0)
3027 {
3028 pathnode->path.pathkeys = subpath->pathkeys;
3029 pathnode->num_workers = 1;
3030 pathnode->single_copy = true;
3031 }
3032
3033 cost_gather(pathnode, root, rel, pathnode->path.param_info, rows);
3034
3035 return pathnode;
3036}
3037
3038/*
3039 * create_subqueryscan_path

Callers 2

generate_union_pathsFunction · 0.85
generate_gather_pathsFunction · 0.85

Calls 2

cost_gatherFunction · 0.85

Tested by

no test coverage detected