Make sequential scans parallel-aware.
Robert Haas <rhaas@postgresql.org>
Make sequential scans parallel-aware. In addition, this path fills in a number of missing bits and pieces in the parallel infrastructure. Paths and plans now have a parallel_aware flag indicating whether whatever parallel-aware logic they have should be engaged. It is believed that we will need this flag for a number of path/plan types, not just sequential scans, which is why the flag is generic rather than part of the SeqScan structures specifically. Also, execParallel.c now gives parallel nodes a chance to initialize their PlanState nodes from the DSM during parallel worker startup. Amit Kapila, with a fair amount of adjustment by me. Review of previous patch versions by Haribabu Kommi and others.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/explain.c | modified | +4 −0 |
| src/backend/executor/execAmi.c | modified | +9 −0 |
| src/backend/executor/execParallel.c | modified | +46 −8 |
| src/backend/executor/nodeSeqscan.c | modified | +103 −33 |
| src/backend/nodes/copyfuncs.c | modified | +1 −0 |
| src/backend/nodes/outfuncs.c | modified | +2 −0 |
| src/backend/nodes/readfuncs.c | modified | +1 −0 |
| src/backend/optimizer/path/allpaths.c | modified | +1 −1 |
| src/backend/optimizer/path/costsize.c | modified | +14 −1 |
| src/backend/optimizer/plan/createplan.c | modified | +24 −20 |
| src/backend/optimizer/plan/planner.c | modified | +1 −1 |
| src/backend/optimizer/util/pathnode.c | modified | +26 −3 |
| src/include/executor/nodeSeqscan.h | modified | +6 −0 |
| src/include/nodes/execnodes.h | modified | +8 −4 |
| src/include/nodes/plannodes.h | modified | +5 −0 |
| src/include/nodes/relation.h | modified | +1 −0 |
| src/include/optimizer/cost.h | modified | +1 −1 |
| src/include/optimizer/pathnode.h | modified | +1 −1 |