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

Function getLocallyExecutableSubplans

src/backend/executor/execUtils.c:2391–2410  ·  view source on GitHub ↗

* Given a plan and a root motion node find all the subplans * between 'root' and the next motion node in the tree */

Source from the content-addressed store, hash-verified

2389 * between 'root' and the next motion node in the tree
2390 */
2391Bitmapset *
2392getLocallyExecutableSubplans(PlannedStmt *plannedstmt, Plan *root_plan)
2393{
2394 SubPlanFinderContext ctx;
2395
2396 ctx.base.node = (Node *) plannedstmt;
2397 ctx.bms_subplans = NULL;
2398
2399 /*
2400 * Note that we begin with plan_tree_walker(root_plan), not
2401 * SubPlanFinderWalker(root_plan). SubPlanFinderWalker() will stop
2402 * at a Motion, but a slice typically has a Motion at the top. We want
2403 * to recurse into the children of the top Motion, as well as any
2404 * initPlans, targetlist, and other fields on the Motion itself. They
2405 * are all considered part of the sending slice.
2406 */
2407 (void) plan_tree_walker((Node *) root_plan, SubPlanFinderWalker, &ctx, true);
2408
2409 return ctx.bms_subplans;
2410}
2411
2412/*
2413 * Copy PARAM_EXEC parameter values that were received from the QD into

Callers 1

InitPlanFunction · 0.85

Calls 1

plan_tree_walkerFunction · 0.85

Tested by

no test coverage detected