]> granicus.if.org Git - postgresql/commitdiff
Enable parallel query by default.
authorRobert Haas <rhaas@postgresql.org>
Tue, 26 Apr 2016 12:31:38 +0000 (08:31 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 26 Apr 2016 12:35:58 +0000 (08:35 -0400)
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

doc/src/sgml/config.sgml
src/backend/optimizer/path/costsize.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample

index 909b3e23c522905efbd37e748433d349d616fae5..dce1daa73ae9ba4cb07569815018f8c0739de623 100644 (file)
@@ -2005,10 +2005,14 @@ include_dir 'conf.d'
        </term>
        <listitem>
         <para>
-         Sets the maximum degree of parallelism for an individual parallel
-         operation.  Note that the requested number of workers may not actually
-         be available at runtime.  Parallel workers are taken from the pool
-         of processes established by <xref linkend="guc-max-worker-processes">.
+         Sets the maximum number of workers that can be started for an
+         individual parallel operation.  Parallel workers are taken from the
+         pool of processes established by
+         <xref linkend="guc-max-worker-processes">.  Note that the requested
+         number of workers may not actually be available at runtime.  If this
+         occurs, the plan will run with fewer workers than expected, which may
+         be inefficient.  The default value is 2.  Setting this value to 0
+         disables parallel query.
         </para>
        </listitem>
       </varlistentry>
index 4917922ab5782fb8e0e716d36e10191391b6dda3..fcb18732d85c5ce6df4ee1234b919035532b34b3 100644 (file)
@@ -113,7 +113,7 @@ int                 effective_cache_size = DEFAULT_EFFECTIVE_CACHE_SIZE;
 
 Cost           disable_cost = 1.0e10;
 
-int                    max_parallel_degree = 0;
+int                    max_parallel_degree = 2;
 
 bool           enable_seqscan = true;
 bool           enable_indexscan = true;
index 60856dda1984c119e0f123a8a14d147876bcc041..26ca06cfc2578e45b0a748cb4130d7afca0e4aaf 100644 (file)
@@ -2662,7 +2662,7 @@ static struct config_int ConfigureNamesInt[] =
                        NULL
                },
                &max_parallel_degree,
-               0, 0, MAX_BACKENDS,
+               2, 0, MAX_BACKENDS,
                NULL, NULL, NULL
        },
 
index 14b537ffb17dc012a84254eaacfa350e6e599cc9..f3e3de0568f5d9c6455cc23c6f06a87ccb324200 100644 (file)
 
 #effective_io_concurrency = 1          # 1-1000; 0 disables prefetching
 #max_worker_processes = 8
-#max_parallel_degree = 0               # max number of worker processes per node
+#max_parallel_degree = 2               # max number of worker processes per node
 #old_snapshot_threshold = -1           # 1min-60d; -1 disables; 0 is immediate
                                                                        # (change requires restart)
 #backend_flush_after = 0               # 0 disables,