gather->num_workers = 1;
gather->single_copy = true;
gather->invisible = (force_parallel_mode == FORCE_PARALLEL_REGRESS);
+
+ /*
+ * Ideally we'd use cost_gather here, but setting up dummy path data
+ * to satisfy it doesn't seem much cleaner than knowing what it does.
+ */
+ gather->plan.startup_cost = top_plan->startup_cost +
+ parallel_setup_cost;
+ gather->plan.total_cost = top_plan->total_cost +
+ parallel_setup_cost + parallel_tuple_cost * top_plan->plan_rows;
+ gather->plan.plan_rows = top_plan->plan_rows;
+ gather->plan.plan_width = top_plan->plan_width;
+ gather->plan.parallel_aware = false;
+
+ /* use parallel mode for parallel plans. */
root->glob->parallelModeNeeded = true;
+
top_plan = &gather->plan;
}