Skip to content

Commit ac725ee

Browse files
committed
doc: Move force_parallel_mode to section for developer options
This GUC has always been classified as a planner option since its introduction in 7c944bd, and was listed in postgresql.conf.sample. As this parameter exists for testing purposes, move it to the section dedicated to developer parameters and hence remove it from postgresql.conf.sample. This will avoid any temptation to play with it on production servers for users that should never really have to touch this parameter. The general description used for developer options is reworded a bit, to take into account the inclusion of force_parallel_mode, per a suggestion from Tom Lane. Per discussion between Tom Lane, Bruce Momjian, Justin Pryzby, Bharath Rupireddy and me. Author: Justin Pryzby, Tom Lane Discussion: https://postgr.es/m/20210403152402.GA8049@momjian.us
1 parent 93f4146 commit ac725ee

File tree

3 files changed

+51
-53
lines changed

3 files changed

+51
-53
lines changed

doc/src/sgml/config.sgml

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5912,51 +5912,6 @@ SELECT * FROM parent WHERE key = 2400;
59125912
</listitem>
59135913
</varlistentry>
59145914

5915-
<varlistentry id="guc-force-parallel-mode" xreflabel="force_parallel_mode">
5916-
<term><varname>force_parallel_mode</varname> (<type>enum</type>)
5917-
<indexterm>
5918-
<primary><varname>force_parallel_mode</varname> configuration parameter</primary>
5919-
</indexterm>
5920-
</term>
5921-
<listitem>
5922-
<para>
5923-
Allows the use of parallel queries for testing purposes even in cases
5924-
where no performance benefit is expected.
5925-
The allowed values of <varname>force_parallel_mode</varname> are
5926-
<literal>off</literal> (use parallel mode only when it is expected to improve
5927-
performance), <literal>on</literal> (force parallel query for all queries
5928-
for which it is thought to be safe), and <literal>regress</literal> (like
5929-
<literal>on</literal>, but with additional behavior changes as explained
5930-
below).
5931-
</para>
5932-
5933-
<para>
5934-
More specifically, setting this value to <literal>on</literal> will add
5935-
a <literal>Gather</literal> node to the top of any query plan for which this
5936-
appears to be safe, so that the query runs inside of a parallel worker.
5937-
Even when a parallel worker is not available or cannot be used,
5938-
operations such as starting a subtransaction that would be prohibited
5939-
in a parallel query context will be prohibited unless the planner
5940-
believes that this will cause the query to fail. If failures or
5941-
unexpected results occur when this option is set, some functions used
5942-
by the query may need to be marked <literal>PARALLEL UNSAFE</literal>
5943-
(or, possibly, <literal>PARALLEL RESTRICTED</literal>).
5944-
</para>
5945-
5946-
<para>
5947-
Setting this value to <literal>regress</literal> has all of the same effects
5948-
as setting it to <literal>on</literal> plus some additional effects that are
5949-
intended to facilitate automated regression testing. Normally,
5950-
messages from a parallel worker include a context line indicating that,
5951-
but a setting of <literal>regress</literal> suppresses this line so that the
5952-
output is the same as in non-parallel execution. Also,
5953-
the <literal>Gather</literal> nodes added to plans by this setting are hidden
5954-
in <literal>EXPLAIN</literal> output so that the output matches what
5955-
would be obtained if this setting were turned <literal>off</literal>.
5956-
</para>
5957-
</listitem>
5958-
</varlistentry>
5959-
59605915
<varlistentry id="guc-plan-cache_mode" xreflabel="plan_cache_mode">
59615916
<term><varname>plan_cache_mode</varname> (<type>enum</type>)
59625917
<indexterm>
@@ -10374,11 +10329,10 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1037410329
<title>Developer Options</title>
1037510330

1037610331
<para>
10377-
The following parameters are intended for work on the
10378-
<productname>PostgreSQL</productname> source code, and in some cases
10379-
to assist with recovery of severely damaged databases. There
10380-
should be no reason to use them on a production database.
10381-
As such, they have been excluded from the sample
10332+
The following parameters are intended for developer testing, and
10333+
should never be used on a production database. However, some of
10334+
them can be used to assist with the recovery of severely damaged
10335+
databases. As such, they have been excluded from the sample
1038210336
<filename>postgresql.conf</filename> file. Note that many of these
1038310337
parameters require special source compilation flags to work at all.
1038410338
</para>
@@ -10464,6 +10418,51 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1046410418
</listitem>
1046510419
</varlistentry>
1046610420

10421+
<varlistentry id="guc-force-parallel-mode" xreflabel="force_parallel_mode">
10422+
<term><varname>force_parallel_mode</varname> (<type>enum</type>)
10423+
<indexterm>
10424+
<primary><varname>force_parallel_mode</varname> configuration parameter</primary>
10425+
</indexterm>
10426+
</term>
10427+
<listitem>
10428+
<para>
10429+
Allows the use of parallel queries for testing purposes even in cases
10430+
where no performance benefit is expected.
10431+
The allowed values of <varname>force_parallel_mode</varname> are
10432+
<literal>off</literal> (use parallel mode only when it is expected to improve
10433+
performance), <literal>on</literal> (force parallel query for all queries
10434+
for which it is thought to be safe), and <literal>regress</literal> (like
10435+
<literal>on</literal>, but with additional behavior changes as explained
10436+
below).
10437+
</para>
10438+
10439+
<para>
10440+
More specifically, setting this value to <literal>on</literal> will add
10441+
a <literal>Gather</literal> node to the top of any query plan for which this
10442+
appears to be safe, so that the query runs inside of a parallel worker.
10443+
Even when a parallel worker is not available or cannot be used,
10444+
operations such as starting a subtransaction that would be prohibited
10445+
in a parallel query context will be prohibited unless the planner
10446+
believes that this will cause the query to fail. If failures or
10447+
unexpected results occur when this option is set, some functions used
10448+
by the query may need to be marked <literal>PARALLEL UNSAFE</literal>
10449+
(or, possibly, <literal>PARALLEL RESTRICTED</literal>).
10450+
</para>
10451+
10452+
<para>
10453+
Setting this value to <literal>regress</literal> has all of the same effects
10454+
as setting it to <literal>on</literal> plus some additional effects that are
10455+
intended to facilitate automated regression testing. Normally,
10456+
messages from a parallel worker include a context line indicating that,
10457+
but a setting of <literal>regress</literal> suppresses this line so that the
10458+
output is the same as in non-parallel execution. Also,
10459+
the <literal>Gather</literal> nodes added to plans by this setting are hidden
10460+
in <literal>EXPLAIN</literal> output so that the output matches what
10461+
would be obtained if this setting were turned <literal>off</literal>.
10462+
</para>
10463+
</listitem>
10464+
</varlistentry>
10465+
1046710466
<varlistentry id="guc-ignore-system-indexes" xreflabel="ignore_system_indexes">
1046810467
<term><varname>ignore_system_indexes</varname> (<type>boolean</type>)
1046910468
<indexterm>

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4922,10 +4922,10 @@ static struct config_enum ConfigureNamesEnum[] =
49224922
},
49234923

49244924
{
4925-
{"force_parallel_mode", PGC_USERSET, QUERY_TUNING_OTHER,
4925+
{"force_parallel_mode", PGC_USERSET, DEVELOPER_OPTIONS,
49264926
gettext_noop("Forces use of parallel query facilities."),
49274927
gettext_noop("If possible, run query using a parallel worker and with parallel restrictions."),
4928-
GUC_EXPLAIN
4928+
GUC_NOT_IN_SAMPLE | GUC_EXPLAIN
49294929
},
49304930
&force_parallel_mode,
49314931
FORCE_PARALLEL_OFF, force_parallel_mode_options,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@
421421
#from_collapse_limit = 8
422422
#join_collapse_limit = 8 # 1 disables collapsing of explicit
423423
# JOIN clauses
424-
#force_parallel_mode = off
425424
#jit = on # allow JIT compilation
426425
#plan_cache_mode = auto # auto, force_generic_plan or
427426
# force_custom_plan

0 commit comments

Comments
 (0)