int save_indent = es->indent;
bool haschildren;
+ if (IsA(planstate, GatherState))
+ {
+ Gather *gather = (Gather *) plan;
+ if (gather->single_copy)
+ {
+ ExplainNode(outerPlanState(planstate), ancestors, relationship,
+ plan_name, es);
+ return;
+ }
+ }
+
switch (nodeTag(plan))
{
case T_Result:
*/
bool need_sort_for_grouping = false;
- result_plan = create_plan(root, best_path);
+ /* Try to run it in a worker. */
+ if (best_path->parallel_safe)
+ best_path = (Path *)
+ create_single_copy_gather_path(root, final_rel,
+ best_path, NULL);
+
current_pathkeys = best_path->pathkeys;
/* Detect if we'll need an explicit sort for grouping */
need_tlist_eval = true;
}
+ result_plan = create_plan(root, best_path);
+
/*
* create_plan returns a plan with just a "flat" tlist of required
* Vars. Usually we need to insert the sub_tlist as the tlist of