mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Fix test for subplans in force-parallel mode.
We mustn't force parallel mode if the query has any subplans, since ExecSerializePlan doesn't transmit them to workers. Testing top_plan->initPlan is inadequate because (1) there might be initPlans attached to lower plan nodes, and (2) non-initPlan subplans don't work either. There's certainly room for improvement in those restrictions, but for the moment that's what we've got. Amit Kapila, per report from Andreas Seltenreich Discussion: <8737im6pmh.fsf@credativ.de>
This commit is contained in:
@ -342,11 +342,11 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
|
|||||||
* actually a safe thing to do. (Note: we assume adding a Material node
|
* actually a safe thing to do. (Note: we assume adding a Material node
|
||||||
* above did not change the parallel safety of the plan, so we can still
|
* above did not change the parallel safety of the plan, so we can still
|
||||||
* rely on best_path->parallel_safe. However, that flag doesn't account
|
* rely on best_path->parallel_safe. However, that flag doesn't account
|
||||||
* for initPlans, which render the plan parallel-unsafe.)
|
* for subplans, which we are unable to transmit to workers presently.)
|
||||||
*/
|
*/
|
||||||
if (force_parallel_mode != FORCE_PARALLEL_OFF &&
|
if (force_parallel_mode != FORCE_PARALLEL_OFF &&
|
||||||
best_path->parallel_safe &&
|
best_path->parallel_safe &&
|
||||||
top_plan->initPlan == NIL)
|
glob->subplans == NIL)
|
||||||
{
|
{
|
||||||
Gather *gather = makeNode(Gather);
|
Gather *gather = makeNode(Gather);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user