aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2018-07-19 13:49:43 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2018-07-19 13:49:43 +0300
commit5220bb7533f9891b1e071da6461d5c387e8f7b09 (patch)
treebdf9a0a35879d8d1eacae28f9eac2cfdea79c3cf /src/include/nodes/execnodes.h
parentb33ef397a1698ddd06f325d0f92a6643ec55577f (diff)
downloadpostgresql-5220bb7533f9891b1e071da6461d5c387e8f7b09.tar.gz
postgresql-5220bb7533f9891b1e071da6461d5c387e8f7b09.zip
Expand run-time partition pruning to work with MergeAppend
This expands the support for the run-time partition pruning which was added for Append in 499be013de to also allow unneeded subnodes of a MergeAppend to be removed. Author: David Rowley Discussion: https://www.postgresql.org/message-id/CAKJS1f_F_V8D7Wu-HVdnH7zCUxhoGK8XhLLtd%3DCu85qDZzXrgg%40mail.gmail.com
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 20140a35e52..018f50bbb71 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -1106,6 +1106,12 @@ struct AppendState
* slots current output tuple of each subplan
* heap heap of active tuples
* initialized true if we have fetched first tuple from each subplan
+ * noopscan true if partition pruning proved that none of the
+ * mergeplans can contain a record to satisfy this query.
+ * prune_state details required to allow partitions to be
+ * eliminated from the scan, or NULL if not possible.
+ * valid_subplans for runtime pruning, valid mergeplans indexes to
+ * scan.
* ----------------
*/
typedef struct MergeAppendState
@@ -1118,6 +1124,9 @@ typedef struct MergeAppendState
TupleTableSlot **ms_slots; /* array of length ms_nplans */
struct binaryheap *ms_heap; /* binary heap of slot indices */
bool ms_initialized; /* are subplans started? */
+ bool ms_noopscan;
+ struct PartitionPruneState *ms_prune_state;
+ Bitmapset *ms_valid_subplans;
} MergeAppendState;
/* ----------------