diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-04-08 11:14:56 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-04-08 11:14:56 -0400 |
commit | 25fe8b5f1ac93c3ec01519854e4f554b2e57a926 (patch) | |
tree | 38e7e8d5bbe0d6f6ab67f19eb38d0e2e5fdcd9e5 /src/backend/access | |
parent | b0b64f65054e6b858b845b46298a624aaaea1deb (diff) | |
download | postgresql-25fe8b5f1ac93c3ec01519854e4f554b2e57a926.tar.gz postgresql-25fe8b5f1ac93c3ec01519854e4f554b2e57a926.zip |
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/backend/access')
-rw-r--r-- | src/backend/access/common/reloptions.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index ea0755a8785..797be63c44b 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -26,6 +26,7 @@ #include "commands/tablespace.h" #include "commands/view.h" #include "nodes/makefuncs.h" +#include "postmaster/postmaster.h" #include "utils/array.h" #include "utils/attoptcache.h" #include "utils/builtins.h" @@ -267,6 +268,15 @@ static relopt_int intRelOpts[] = 0, 0, 0 #endif }, + { + { + "parallel_degree", + "Number of parallel processes that can be used per executor node for this relation.", + RELOPT_KIND_HEAP, + AccessExclusiveLock + }, + -1, 0, MAX_BACKENDS + }, /* list terminator */ {{NULL}} @@ -1251,8 +1261,7 @@ fillRelOptions(void *rdopts, Size basesize, /* - * Option parser for anything that uses StdRdOptions (i.e. fillfactor and - * autovacuum) + * Option parser for anything that uses StdRdOptions. */ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) @@ -1291,7 +1300,9 @@ default_reloptions(Datum reloptions, bool validate, relopt_kind kind) {"autovacuum_analyze_scale_factor", RELOPT_TYPE_REAL, offsetof(StdRdOptions, autovacuum) +offsetof(AutoVacOpts, analyze_scale_factor)}, {"user_catalog_table", RELOPT_TYPE_BOOL, - offsetof(StdRdOptions, user_catalog_table)} + offsetof(StdRdOptions, user_catalog_table)}, + {"parallel_degree", RELOPT_TYPE_INT, + offsetof(StdRdOptions, parallel_degree)} }; options = parseRelOptions(reloptions, validate, kind, &numoptions); |