postgresql/src/include/executor
Robert Haas e89a71fb44 Pass InitPlan values to workers via Gather (Merge).
If a PARAM_EXEC parameter is used below a Gather (Merge) but the InitPlan
that computes it is attached to or above the Gather (Merge), force the
value to be computed before starting parallelism and pass it down to all
workers.  This allows us to use parallelism in cases where it previously
would have had to be rejected as unsafe.  We do - in this case - lose the
optimization that the value is only computed if it's actually used.  An
alternative strategy would be to have the first worker that needs the value
compute it, but one downside of that approach is that we'd then need to
select a parallel-safe path to compute the parameter value; it couldn't for
example contain a Gather (Merge) node.  At some point in the future, we
might want to consider both approaches.

Independent of that consideration, there is a great deal more work that
could be done to make more kinds of PARAM_EXEC parameters parallel-safe.
This infrastructure could be used to allow a Gather (Merge) on the inner
side of a nested loop (although that's not a very appealing plan) and
cases where the InitPlan is attached below the Gather (Merge) could be
addressed as well using various techniques.  But this is a good start.

Amit Kapila, reviewed and revised by me.  Reviewing and testing from
Kuntal Ghosh, Haribabu Kommi, and Tushar Ahuja.

Discussion: http://postgr.es/m/CAA4eK1LV0Y1AUV4cUCdC+sYOx0Z0-8NAJ2Pd9=UKsbQ5Sr7+JQ@mail.gmail.com
2017-11-16 12:06:14 -05:00
..
execdebug.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
execdesc.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
execExpr.h Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
execParallel.h Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
execPartition.h Centralize executor-related partitioning code. 2017-11-15 10:26:25 -05:00
executor.h Centralize executor-related partitioning code. 2017-11-15 10:26:25 -05:00
functions.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
hashjoin.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
instrument.h Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
nodeAgg.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeAppend.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeBitmapAnd.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodeBitmapHeapscan.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeBitmapIndexscan.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodeBitmapOr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodeCtescan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeCustom.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeForeignscan.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeFunctionscan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeGather.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeGatherMerge.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeGroup.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeHash.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeHashjoin.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeIndexonlyscan.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeIndexscan.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeLimit.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeLockRows.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeMaterial.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeMergeAppend.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeMergejoin.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeModifyTable.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeNamedtuplestorescan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeNestloop.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeProjectSet.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeRecursiveunion.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeResult.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeSamplescan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeSeqscan.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeSetOp.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeSort.h Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
nodeSubplan.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nodeSubqueryscan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeTableFuncscan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeTidscan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeUnique.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeValuesscan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeWindowAgg.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
nodeWorktablescan.h Move ExecProcNode from dispatch to function pointer based model. 2017-07-30 16:18:21 -07:00
spi.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
spi_priv.h Fix crash when logical decoding is invoked from a PL function. 2017-10-06 19:18:58 -04:00
tablefunc.h Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
tqueue.h Remove TupleDesc remapping logic from tqueue.c. 2017-09-14 19:59:29 -07:00
tstoreReceiver.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
tuptable.h Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00