Skip to content

Commit 01f08cb

Browse files
committed
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>
1 parent 90f8b4b commit 01f08cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
327327
* actually a safe thing to do. (Note: we assume adding a Material node
328328
* above did not change the parallel safety of the plan, so we can still
329329
* rely on best_path->parallel_safe. However, that flag doesn't account
330-
* for initPlans, which render the plan parallel-unsafe.)
330+
* for subplans, which we are unable to transmit to workers presently.)
331331
*/
332332
if (force_parallel_mode != FORCE_PARALLEL_OFF &&
333333
best_path->parallel_safe &&
334-
top_plan->initPlan == NIL)
334+
glob->subplans == NIL)
335335
{
336336
Gather *gather = makeNode(Gather);
337337

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy