Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 77cd477

Browse files
committed
Enable parallel query by default.
Change max_parallel_degree default from 0 to 2. It is possible that this is not a good idea, or that we should go with 1 worker rather than 2, but we won't find out without trying it. Along the way, reword the documentation for max_parallel_degree a little bit to hopefully make it more clear. Discussion: 20160420174631.3qjjhpwsvvx5bau5@alap3.anarazel.de
1 parent b7351ce commit 77cd477

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

doc/src/sgml/config.sgml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,10 +2005,14 @@ include_dir 'conf.d'
20052005
</term>
20062006
<listitem>
20072007
<para>
2008-
Sets the maximum degree of parallelism for an individual parallel
2009-
operation. Note that the requested number of workers may not actually
2010-
be available at runtime. Parallel workers are taken from the pool
2011-
of processes established by <xref linkend="guc-max-worker-processes">.
2008+
Sets the maximum number of workers that can be started for an
2009+
individual parallel operation. Parallel workers are taken from the
2010+
pool of processes established by
2011+
<xref linkend="guc-max-worker-processes">. Note that the requested
2012+
number of workers may not actually be available at runtime. If this
2013+
occurs, the plan will run with fewer workers than expected, which may
2014+
be inefficient. The default value is 2. Setting this value to 0
2015+
disables parallel query.
20122016
</para>
20132017
</listitem>
20142018
</varlistentry>

src/backend/optimizer/path/costsize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int effective_cache_size = DEFAULT_EFFECTIVE_CACHE_SIZE;
113113

114114
Cost disable_cost = 1.0e10;
115115

116-
int max_parallel_degree = 0;
116+
int max_parallel_degree = 2;
117117

118118
bool enable_seqscan = true;
119119
bool enable_indexscan = true;

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,7 @@ static struct config_int ConfigureNamesInt[] =
26622662
NULL
26632663
},
26642664
&max_parallel_degree,
2665-
0, 0, MAX_BACKENDS,
2665+
2, 0, MAX_BACKENDS,
26662666
NULL, NULL, NULL
26672667
},
26682668

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167

168168
#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
169169
#max_worker_processes = 8
170-
#max_parallel_degree = 0 # max number of worker processes per node
170+
#max_parallel_degree = 2 # max number of worker processes per node
171171
#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
172172
# (change requires restart)
173173
#backend_flush_after = 0 # 0 disables,

0 commit comments

Comments
 (0)