postgresql/src/include/nodes
Tom Lane 1c2cb2744b Fix run-time partition pruning for appends with multiple source rels.
The previous coding here supposed that if run-time partitioning applied to
a particular Append/MergeAppend plan, then all child plans of that node
must be members of a single partitioning hierarchy.  This is totally wrong,
since an Append could be formed from a UNION ALL: we could have multiple
hierarchies sharing the same Append, or child plans that aren't part of any
hierarchy.

To fix, restructure the related plan-time and execution-time data
structures so that we can have a separate list or array for each
partitioning hierarchy.  Also track subplans that are not part of any
hierarchy, and make sure they don't get pruned.

Per reports from Phil Florent and others.  Back-patch to v11, since
the bug originated there.

David Rowley, with a lot of cosmetic adjustments by me; thanks also
to Amit Langote for review.

Discussion: https://postgr.es/m/HE1PR03MB17068BB27404C90B5B788BCABA7B0@HE1PR03MB1706.eurprd03.prod.outlook.com
2018-08-01 19:42:52 -04:00
..
bitmapset.h Add bms_prev_member function 2018-04-07 17:54:39 -03:00
execnodes.h Expand run-time partition pruning to work with MergeAppend 2018-07-19 13:49:43 +03:00
extensible.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
lockoptions.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
makefuncs.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
memnodes.h Allow memory contexts to have both fixed and variable ident strings. 2018-03-27 16:46:51 -04:00
nodeFuncs.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes.h Fix run-time partition pruning for appends with multiple source rels. 2018-08-01 19:42:52 -04:00
params.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
parsenodes.h Fix two oversights from 9ebe0572 which refactored cluster_rel 2018-07-29 22:00:42 +09:00
pg_list.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
plannodes.h Fix run-time partition pruning for appends with multiple source rels. 2018-08-01 19:42:52 -04:00
primnodes.h Relocate partition pruning structs to a saner place. 2018-06-10 16:30:14 -04:00
print.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
readfuncs.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
relation.h Fix bugs with degenerate window ORDER BY clauses in GROUPS/RANGE mode. 2018-07-11 12:07:20 -04:00
replnodes.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
tidbitmap.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
value.h Change internal integer representation of Value node 2018-03-13 09:56:25 -04:00