summaryrefslogtreecommitdiff
path: root/src/include/utils/rel.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-04-08 11:14:56 -0400
committerRobert Haas <rhaas@postgresql.org>2016-04-08 11:14:56 -0400
commit25fe8b5f1ac93c3ec01519854e4f554b2e57a926 (patch)
tree38e7e8d5bbe0d6f6ab67f19eb38d0e2e5fdcd9e5 /src/include/utils/rel.h
parentb0b64f65054e6b858b845b46298a624aaaea1deb (diff)
downloadpostgresql-25fe8b5f1ac93c3ec01519854e4f554b2e57a926.tar.gz
Add a 'parallel_degree' reloption.
The code that estimates what parallel degree should be uesd for the scan of a relation is currently rather stupid, so add a parallel_degree reloption that can be used to override the planner's rather limited judgement. Julien Rouhaud, reviewed by David Rowley, James Sewell, Amit Kapila, and me. Some further hacking by me.
Diffstat (limited to 'src/include/utils/rel.h')
-rw-r--r--src/include/utils/rel.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 51eb27a381..c7582c2a11 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -206,6 +206,7 @@ typedef struct StdRdOptions
AutoVacOpts autovacuum; /* autovacuum-related options */
bool user_catalog_table; /* use as an additional catalog
* relation */
+ int parallel_degree; /* max number of parallel workers */
} StdRdOptions;
#define HEAP_MIN_FILLFACTOR 10
@@ -242,6 +243,14 @@ typedef struct StdRdOptions
((relation)->rd_options ? \
((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false)
+/*
+ * RelationGetParallelDegree
+ * Returns the relation's parallel_degree. Note multiple eval of argument!
+ */
+#define RelationGetParallelDegree(relation, defaultpd) \
+ ((relation)->rd_options ? \
+ ((StdRdOptions *) (relation)->rd_options)->parallel_degree : (defaultpd))
+
/*
* ViewOptions