postgresql/src/include
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
..
access Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
bootstrap Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catalog Centralize executor-related partitioning code. 2017-11-15 10:26:25 -05:00
commands Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
common Rewrite strnlen replacement implementation from 8a241792f9. 2017-10-10 14:50:30 -07:00
datatype Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
executor Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
fe_utils Provide a test for variable existence in psql 2017-09-21 19:02:23 -04:00
foreign Basic partition-wise join functionality. 2017-10-06 11:11:10 -04:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Refactor permissions checks for large objects. 2017-11-09 12:56:07 -05:00
mb Add more efficient functions to pqformat API. 2017-10-11 16:01:52 -07:00
nodes Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
optimizer Add parallel_leader_participation GUC. 2017-11-15 08:23:18 -05:00
parser Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
port Define _WINSOCK_DEPRECATED_NO_WARNINGS in all MSVC builds. 2017-11-16 12:03:04 -05:00
portability Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postmaster Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix race condition with unprotected use of a latch pointer variable. 2017-10-03 14:00:56 -04:00
rewrite Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
snowball Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
statistics Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
storage Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
tcop Back out the session_start and session_end hooks feature. 2017-11-16 11:35:02 -05:00
tsearch Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
utils Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Further refactoring of c.h and nearby files. 2017-11-16 10:36:21 -05:00
fmgr.h Allow the built-in ordered-set aggregates to share transition state. 2017-10-16 15:51:23 -04:00
funcapi.h Support domains over composite types. 2017-10-26 13:47:45 -04:00
getaddrinfo.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
getopt_long.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Remove replacement selection sort. 2017-09-29 10:25:44 -04:00
pg_config.h.in Prevent int128 from requiring more than MAXALIGN alignment. 2017-11-14 15:03:55 -05:00
pg_config.h.win32 Prevent int128 from requiring more than MAXALIGN alignment. 2017-11-14 15:03:55 -05:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Restrict lo_import()/lo_export() via SQL permissions not hard-wired checks. 2017-11-09 12:36:58 -05:00
pg_getopt.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_trace.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pgstat.h Avoid use of non-portable strnlen() in pgstat_clip_activity(). 2017-09-19 14:25:47 -07:00
pgtar.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
pgtime.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
port.h Further refactoring of c.h and nearby files. 2017-11-16 10:36:21 -05:00
postgres.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rusagestub.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
windowapi.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00