summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorRobert Haas2015-11-11 13:57:52 +0000
committerRobert Haas2015-11-11 13:57:52 +0000
commitf0661c4e8c44c0ec7acd4ea7c82e85b265447398 (patch)
tree0a31416ab40a9be4ab0f43c6ddd73221eed9dec6 /src/include/nodes
parentf764ecd81b2a8a1e9000d43a73ca5eec8e8008bc (diff)
Make sequential scans parallel-aware.
In addition, this path fills in a number of missing bits and pieces in the parallel infrastructure. Paths and plans now have a parallel_aware flag indicating whether whatever parallel-aware logic they have should be engaged. It is believed that we will need this flag for a number of path/plan types, not just sequential scans, which is why the flag is generic rather than part of the SeqScan structures specifically. Also, execParallel.c now gives parallel nodes a chance to initialize their PlanState nodes from the DSM during parallel worker startup. Amit Kapila, with a fair amount of adjustment by me. Review of previous patch versions by Haribabu Kommi and others.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h12
-rw-r--r--src/include/nodes/plannodes.h5
-rw-r--r--src/include/nodes/relation.h1
3 files changed, 14 insertions, 4 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 58ec889b2f0..eb3591a663f 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -1248,11 +1248,15 @@ typedef struct ScanState
TupleTableSlot *ss_ScanTupleSlot;
} ScanState;
-/*
- * SeqScan uses a bare ScanState as its state node, since it needs
- * no additional fields.
+/* ----------------
+ * SeqScanState information
+ * ----------------
*/
-typedef ScanState SeqScanState;
+typedef struct SeqScanState
+{
+ ScanState ss; /* its first field is NodeTag */
+ Size pscan_len; /* size of parallel heap scan descriptor */
+} SeqScanState;
/* ----------------
* SampleScanState information
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 6b28c8e28f4..292219db51f 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -109,6 +109,11 @@ typedef struct Plan
int plan_width; /* average row width in bytes */
/*
+ * information needed for parallel query
+ */
+ bool parallel_aware; /* engage parallel-aware logic? */
+
+ /*
* Common structural data for all Plan types.
*/
int plan_node_id; /* unique across entire final plan tree */
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index 6cf2e24ce7d..d7406cc6149 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -753,6 +753,7 @@ typedef struct Path
RelOptInfo *parent; /* the relation this path can build */
ParamPathInfo *param_info; /* parameterization info, or NULL if none */
+ bool parallel_aware; /* engage parallel-aware logic? */
/* estimated size/costs for path (see costsize.c for more info) */
double rows; /* estimated number of result tuples */