Wiki / Configuration Parameters
debug_parallel_query
Allows the use of parallel queries for testing purposes even in cases where no performance benefit is expected. The allowed values of debug_parallel_query are off (use parallel mode only when it is expected to improve performance), on (force parallel query for all queries for which it is thought to be safe), and regress (like on, but with additional behavior changes as explained below). More specifically, setting this value to on will add a Gather node to the top of any query plan for which this appears to be safe, so that the query runs inside of a parallel worker. Even when a parallel worker is not available or cannot be used, operations such as starting a subtransaction that would be prohibited in a parallel query context will be prohibited unless the planner believes that this will cause the query to fail. If failures or unexpected results occur when this option is set, some functions used by the query may need to be marked PARALLEL UNSAFE (or, possibly, PARALLEL RESTRICTED). Setting this value to regress has all of the same effects as setting it to on plus some additional effects that are intended to facilitate automated regression testing. Normally, messages from a parallel worker include a context line indicating that, but a setting of regress suppresses this line so that the output is the same as in non-parallel execution. Also, the Gather nodes added to plans by this setting are hidden in EXPLAIN output so that the output matches what would be obtained if this setting were turned off.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- boot val
- off
- category
- Developer Options
- context
- user
- doc same as
- Unknown
- documented
- true
- enumvals
- off, on, regress
- extra desc
- This can be useful for testing the parallel query infrastructure by forcing the planner to generate plans that contain nodes that perform tuple communication between workers and the main process.
- lang
- en
- max val
- Unknown
- metadata version
- 18
- min val
- Unknown
- name
- debug_parallel_query
- short desc
- Forces the planner's use parallel query nodes.
- source
- pg-settings-source-snapshot
- unit
- Unknown
- vartype
- enum
Definition PG 18
Allows the use of parallel queries for testing purposes even in cases
where no performance benefit is expected.
The allowed values of debug_parallel_query are
off (use parallel mode only when it is expected to improve
performance), on (force parallel query for all queries
for which it is thought to be safe), and regress (like
on, but with additional behavior changes as explained
below).
More specifically, setting this value to on will add
a Gather node to the top of any query plan for which this
appears to be safe, so that the query runs inside of a parallel worker.
Even when a parallel worker is not available or cannot be used,
operations such as starting a subtransaction that would be prohibited
in a parallel query context will be prohibited unless the planner
believes that this will cause the query to fail. If failures or
unexpected results occur when this option is set, some functions used
by the query may need to be marked PARALLEL UNSAFE
(or, possibly, PARALLEL RESTRICTED).
Setting this value to regress has all of the same effects
as setting it to on plus some additional effects that are
intended to facilitate automated regression testing. Normally,
messages from a parallel worker include a context line indicating that,
but a setting of regress suppresses this line so that the
output is the same as in non-parallel execution. Also,
the Gather nodes added to plans by this setting are hidden
in EXPLAIN output so that the output matches what
would be obtained if this setting were turned off.
Compare versions
Complete source facts
doc html
<p>
Allows the use of parallel queries for testing purposes even in cases
where no performance benefit is expected.
The allowed values of <code class="varname">debug_parallel_query</code> are
<code class="literal">off</code> (use parallel mode only when it is expected to improve
performance), <code class="literal">on</code> (force parallel query for all queries
for which it is thought to be safe), and <code class="literal">regress</code> (like
<code class="literal">on</code>, but with additional behavior changes as explained
below).
</p><p>
More specifically, setting this value to <code class="literal">on</code> will add
a <code class="literal">Gather</code> node to the top of any query plan for which this
appears to be safe, so that the query runs inside of a parallel worker.
Even when a parallel worker is not available or cannot be used,
operations such as starting a subtransaction that would be prohibited
in a parallel query context will be prohibited unless the planner
believes that this will cause the query to fail. If failures or
unexpected results occur when this option is set, some functions used
by the query may need to be marked <code class="literal">PARALLEL UNSAFE</code>
(or, possibly, <code class="literal">PARALLEL RESTRICTED</code>).
</p><p>
Setting this value to <code class="literal">regress</code> has all of the same effects
as setting it to <code class="literal">on</code> plus some additional effects that are
intended to facilitate automated regression testing. Normally,
messages from a parallel worker include a context line indicating that,
but a setting of <code class="literal">regress</code> suppresses this line so that the
output is the same as in non-parallel execution. Also,
the <code class="literal">Gather</code> nodes added to plans by this setting are hidden
in <code class="literal">EXPLAIN</code> output so that the output matches what
would be obtained if this setting were turned <code class="literal">off</code>.
</p>documentation revision
{"inputs":[{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"a3f6a107ed6ba4edaf6df03e52f4a469bd09350d545e4ff419e62844025ec1cf","version":"18.7"},{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"e7e22aa5738a1d376b84af1adca796c5e14746266733f925eb50c3ef86a50655","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · wiki-repair-20261023:b6c5a3975c8e17dc40f13ffe34de7dd417cf00d9193ec3cbf375ee3607b3f44d
Text language: en · wiki-repair-20261023:b6c5a3975c8e17dc40f13ffe34de7dd417cf00d9193ec3cbf375ee3607b3f44d