Please sign in to comment.
Generate parallel sequential scan plans in simple cases.
Add a new flag, consider_parallel, to each RelOptInfo, indicating whether a plan for that relation could conceivably be run inside of a parallel worker. Right now, we're pretty conservative: for example, it might be possible to defer applying a parallel-restricted qual in a worker, and later do it in the leader, but right now we just don't try to parallelize access to that relation. That's probably the right decision in most cases, anyway. Using the new flag, generate parallel sequential scan plans for plain baserels, meaning that we now have parallel sequential scan in PostgreSQL. The logic here is pretty unsophisticated right now: the costing model probably isn't right in detail, and we can't push joins beneath Gather nodes, so the number of plans that can actually benefit from this is pretty limited right now. Lots more work is needed. Nevertheless, it seems time to enable this functionality so that all this code can actually be tested easily by users and developers. Note that, if you wish to test this functionality, it will be necessary to set max_parallel_degree to a value greater than the default of 0. Once a few more loose ends have been tidied up here, we might want to consider changing the default value of this GUC, but I'm leaving it alone for now. Along the way, fix a bug in cost_gather: the previous coding thought that a Gather node's transfer overhead should be costed on the basis of the relation size rather than the number of tuples that actually need to be passed off to the leader. Patch by me, reviewed in earlier versions by Amit Kapila.
- Loading branch information...
Showing with 400 additions and 44 deletions.
- +1 −0 src/backend/nodes/outfuncs.c
- +187 −3 src/backend/optimizer/path/allpaths.c
- +1 −1 src/backend/optimizer/path/costsize.c
- +12 −0 src/backend/optimizer/plan/planmain.c
- +5 −4 src/backend/optimizer/plan/planner.c
- +148 −35 src/backend/optimizer/util/clauses.c
- +21 −0 src/backend/optimizer/util/relnode.c
- +22 −0 src/backend/utils/cache/lsyscache.c
- +1 −0 src/include/nodes/relation.h
- +1 −1 src/include/optimizer/clauses.h
- +1 −0 src/include/utils/lsyscache.h
Oops, something went wrong.