Skip to content

Commit f24cf96

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 c5f365f commit f24cf96

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
@@ -342,11 +342,11 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
342342
* actually a safe thing to do. (Note: we assume adding a Material node
343343
* above did not change the parallel safety of the plan, so we can still
344344
* rely on best_path->parallel_safe. However, that flag doesn't account
345-
* for initPlans, which render the plan parallel-unsafe.)
345+
* for subplans, which we are unable to transmit to workers presently.)
346346
*/
347347
if (force_parallel_mode != FORCE_PARALLEL_OFF &&
348348
best_path->parallel_safe &&
349-
top_plan->initPlan == NIL)
349+
glob->subplans == NIL)
350350
{
351351
Gather *gather = makeNode(Gather);
352352

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