diff options
| author | Robert Haas | 2016-04-08 15:14:56 +0000 |
|---|---|---|
| committer | Robert Haas | 2016-04-08 15:14:56 +0000 |
| commit | 25fe8b5f1ac93c3ec01519854e4f554b2e57a926 (patch) | |
| tree | 38e7e8d5bbe0d6f6ab67f19eb38d0e2e5fdcd9e5 /src/include | |
| parent | b0b64f65054e6b858b845b46298a624aaaea1deb (diff) | |
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')
| -rw-r--r-- | src/include/nodes/relation.h | 1 | ||||
| -rw-r--r-- | src/include/utils/rel.h | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index d430f6e9fd..e9dfb663c2 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -522,6 +522,7 @@ typedef struct RelOptInfo double allvisfrac; PlannerInfo *subroot; /* if subquery */ List *subplan_params; /* if subquery */ + int rel_parallel_degree; /* wanted number of parallel workers */ /* Information about foreign tables and foreign joins */ Oid serverid; /* identifies server for the table or join */ 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 |
