Allow RTE_SUBQUERY rels to be considered parallel-safe.
There isn't really any reason not to; the original comments here were partly confused about subplans versus subquery-in-FROM, and partly dependent on restrictions that no longer apply now that subqueries return Paths not Plans. Depending on what's inside the subquery, it might fail to produce any parallel_safe Paths, but that's fine. Tom Lane and Robert Haas
This commit is contained in:
parent
4ea9948e58
commit
110a6dbdeb
@ -575,15 +575,19 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel,
|
|||||||
case RTE_SUBQUERY:
|
case RTE_SUBQUERY:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Subplans currently aren't passed to workers. Even if they
|
* There's no intrinsic problem with scanning a subquery-in-FROM
|
||||||
* were, the subplan might be using parallelism internally, and we
|
* (as distinct from a SubPlan or InitPlan) in a parallel worker.
|
||||||
* can't support nested Gather nodes at present. Finally, we
|
* If the subquery doesn't happen to have any parallel-safe paths,
|
||||||
* don't have a good way of knowing whether the subplan involves
|
* then flagging it as consider_parallel won't change anything,
|
||||||
* any parallel-restricted operations. It would be nice to relax
|
* but that's true for plain tables, too. We must set
|
||||||
* this restriction some day, but it's going to take a fair amount
|
* consider_parallel based on the rel's own quals and targetlist,
|
||||||
* of work.
|
* so that if a subquery path is parallel-safe but the quals and
|
||||||
|
* projection we're sticking onto it are not, we correctly mark
|
||||||
|
* the SubqueryScanPath as not parallel-safe. (Note that
|
||||||
|
* set_subquery_pathlist() might push some of these quals down
|
||||||
|
* into the subquery itself, but that doesn't change anything.)
|
||||||
*/
|
*/
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case RTE_JOIN:
|
case RTE_JOIN:
|
||||||
/* Shouldn't happen; we're only considering baserels here. */
|
/* Shouldn't happen; we're only considering baserels here. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user