postgresql/src
Tom Lane 39151781c8 Fix testing of parallel-safety of SubPlans.
is_parallel_safe() supposed that the only relevant property of a SubPlan
was the parallel safety of the referenced subplan tree.  This is wrong:
the testexpr or args subtrees might contain parallel-unsafe stuff, as
demonstrated by the test case added here.  However, just recursing into the
subtrees fails in a different way: we'll typically find PARAM_EXEC Params
representing the subplan's output columns in the testexpr.  The previous
coding supposed that any Param must be treated as parallel-restricted, so
that a naive attempt at fixing this disabled parallel pushdown of SubPlans
altogether.  We must instead determine, for any visited Param, whether it
is one that would be computed by a surrounding SubPlan node; if so, it's
safe to push down along with the SubPlan node.

We might later be able to extend this logic to cope with Params used for
correlated subplans and other cases; but that's a task for v11 or beyond.

Tom Lane and Amit Kapila

Discussion: https://postgr.es/m/7064.1492022469@sss.pgh.pa.us
2017-04-18 15:43:56 -04:00
..
backend Fix testing of parallel-safety of SubPlans. 2017-04-18 15:43:56 -04:00
bin Rename "scram" to "scram-sha-256" in pg_hba.conf and password_encryption. 2017-04-18 14:50:50 +03:00
common Fix new warnings from GCC 7 2017-04-17 13:59:46 -04:00
fe_utils Allow psql variable substitution to occur in backtick command strings. 2017-04-01 21:44:54 -04:00
include Fix testing of parallel-safety of SubPlans. 2017-04-18 15:43:56 -04:00
interfaces Remove trailing spaces in some output 2017-04-13 23:15:52 -04:00
makefiles Try to fix non-MSVC Windows builds in the wake of logical replication. 2017-01-20 12:51:31 -05:00
pl Improve castNode notation by introducing list-extraction-specific variants. 2017-04-10 13:51:53 -04:00
port Downcase "Wincrypt.h" 2017-04-15 09:47:36 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Fix testing of parallel-safety of SubPlans. 2017-04-18 15:43:56 -04:00
timezone Fix new warnings from GCC 7 2017-04-17 13:59:46 -04:00
tools docs: update major release instructions 2017-04-13 10:19:12 -04:00
tutorial Recommend wrappers of PG_DETOAST_DATUM_PACKED(). 2017-03-12 19:35:33 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Remove use of Jade and DSSSL 2017-04-06 22:09:11 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00