postgresql/src/backend
Robert Haas 0927d2f46d Let Parallel Append over simple UNION ALL have partial subpaths.
A simple UNION ALL gets flattened into an appendrel of subquery
RTEs, but up until now it's been impossible for the appendrel to use
the partial paths for the subqueries, so we can implement the
appendrel as a Parallel Append but only one with non-partial paths
as children.

There are three separate obstacles to removing that limitation.
First, when planning a subquery, propagate any partial paths to the
final_rel so that they are potentially visible to outer query levels
(but not if they have initPlans attached, because that wouldn't be
safe).  Second, after planning a subquery, propagate any partial paths
for the final_rel to the subquery RTE in the outer query level in the
same way we do for non-partial paths.  Third, teach finalize_plan() to
account for the possibility that the fake parameter we use for rescan
signalling when the plan contains a Gather (Merge) node may be
propagated from an outer query level.

Patch by me, reviewed and tested by Amit Khandekar, Rajkumar
Raghuwanshi, and Ashutosh Bapat.  Test cases based on examples by
Rajkumar Raghuwanshi.

Discussion: http://postgr.es/m/CA+Tgmoa6L9A1nNCk3aTDVZLZ4KkHDn1+tm7mFyFvP+uQPS7bAg@mail.gmail.com
2018-03-13 16:34:08 -04:00
..
access Fix HEAP_INSERT_IS_SPECULATIVE to HEAP_INSERT_SPECULATIVE in comments. 2018-03-05 15:28:03 -08:00
bootstrap Add missing debug lines during bootstrap 2018-03-07 11:47:35 -03:00
catalog Fix improper uses of canonicalize_qual(). 2018-03-11 18:10:42 -04:00
commands When updating reltuples after ANALYZE, just extrapolate from our sample. 2018-03-13 13:24:27 -04:00
executor Fix parent node of WCO expressions in partitioned tables. 2018-03-05 17:49:59 -08:00
foreign Remove bogus "extern" annotations on function definitions. 2018-02-19 12:07:44 -05:00
lib Minor clean-up in dshash.{c,h}. 2018-03-01 16:25:46 -08:00
libpq Fix up references to scram-sha-256 2018-01-30 16:50:30 -05:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Move strtoint() to common 2018-03-13 10:21:09 -04:00
optimizer Let Parallel Append over simple UNION ALL have partial subpaths. 2018-03-13 16:34:08 -04:00
parser Move strtoint() to common 2018-03-13 10:21:09 -04:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Support huge pages on Windows 2018-01-21 15:40:46 +01:00
postmaster Avoid holding AutovacuumScheduleLock while rechecking table statistics. 2018-03-13 12:28:35 -04:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Refrain from duplicating data in reorderbuffers 2018-03-06 18:34:29 -03:00
rewrite Fix application of identity values in some cases 2018-02-02 14:39:10 -05:00
snowball Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage shm_mq: Fix detach race condition. 2018-03-05 15:12:49 -05:00
tcop Support parameters in CALL 2018-02-22 21:36:48 -05:00
tsearch Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
utils Move strtoint() to common 2018-03-13 10:21:09 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Update copyright for 2018 2018-01-02 23:30:12 -05:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00