* Given a plan and a root motion node find all the subplans * between 'root' and the next motion node in the tree */
| 2389 | * between 'root' and the next motion node in the tree |
| 2390 | */ |
| 2391 | Bitmapset * |
| 2392 | getLocallyExecutableSubplans(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 |
no test coverage detected