mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Revert "Enable parallel SELECT for "INSERT INTO ... SELECT ..."."
To allow inserts in parallel-mode this feature has to ensure that all the constraints, triggers, etc. are parallel-safe for the partition hierarchy which is costly and we need to find a better way to do that. Additionally, we could have used existing cached information in some cases like indexes, domains, etc. to determine the parallel-safety. List of commits reverted, in reverse chronological order:ed62d3737c
Doc: Update description for parallel insert reloption.c8f78b6161
Add a new GUC and a reloption to enable inserts in parallel-mode.c5be48f092
Improve FK trigger parallel-safety check added by05c8482f7f
.e2cda3c20a
Fix use of relcache TriggerDesc field introduced by commit05c8482f7f
.e4e87a32cc
Fix valgrind issue in commit05c8482f7f
.05c8482f7f
Enable parallel SELECT for "INSERT INTO ... SELECT ...". Discussion: https://postgr.es/m/E1lMiB9-0001c3-SY@gemulon.postgresql.org
This commit is contained in:
@ -5072,29 +5072,6 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="guc-enable-parallel-insert" xreflabel="enable_parallel_insert">
|
||||
<term><varname>enable_parallel_insert</varname> (<type>boolean</type>)
|
||||
<indexterm>
|
||||
<primary><varname>enable_parallel_insert</varname> configuration parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Enables or disables the query planner's use of parallel plans for
|
||||
<command>INSERT</command> commands. The default is <literal>on</literal>.
|
||||
When enabled, the planner performs additional parallel-safety checks
|
||||
on the target table's attributes and indexes, in order to determine
|
||||
if it's safe to use a parallel plan for <command>INSERT</command>. In
|
||||
cases such as when the target table has a large number of partitions,
|
||||
and particularly also when that table uses something parallel-unsafe
|
||||
that prevents parallelism, the overhead of these checks may become
|
||||
prohibitively high. To address this potential overhead in these cases,
|
||||
this option can be used to disable the use of parallel plans for
|
||||
<command>INSERT</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</sect2>
|
||||
<sect2 id="runtime-config-query-constants">
|
||||
|
@ -155,9 +155,6 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
|
||||
<listitem>
|
||||
<para><command>SELECT INTO</command></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><command>INSERT INTO ... SELECT</command></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><command>CREATE MATERIALIZED VIEW</command></para>
|
||||
</listitem>
|
||||
|
@ -738,8 +738,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
<para>
|
||||
<literal>SHARE UPDATE EXCLUSIVE</literal> lock will be taken for
|
||||
fillfactor, toast and autovacuum storage parameters, as well as the
|
||||
planner parameters <varname>parallel_workers</varname> and
|
||||
<varname>parallel_insert_enabled</varname>.
|
||||
planner parameter <varname>parallel_workers</varname>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -1369,9 +1369,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
If a table parameter value is set and the
|
||||
equivalent <literal>toast.</literal> parameter is not, the TOAST table
|
||||
will use the table's parameter value.
|
||||
These parameters, with the exception of
|
||||
<literal>parallel_insert_enabled</literal>, are not supported on partitioned
|
||||
tables, but may be specified for individual leaf partitions.
|
||||
Specifying these parameters for partitioned tables is not supported,
|
||||
but you may specify them for individual leaf partitions.
|
||||
</para>
|
||||
|
||||
<variablelist>
|
||||
@ -1441,32 +1440,6 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="reloption-parallel-insert-enabled" xreflabel="parallel_insert_enabled">
|
||||
<term><literal>parallel_insert_enabled</literal> (<type>boolean</type>)
|
||||
<indexterm>
|
||||
<primary><varname>parallel_insert_enabled</varname> storage parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Enables or disables the query planner's use of parallel insert for
|
||||
this table. When enabled (and provided that
|
||||
<xref linkend="guc-enable-parallel-insert"/> is also <literal>true</literal>),
|
||||
the planner performs additional parallel-safety checks on the table's
|
||||
attributes and indexes, in order to determine if it's safe to use a
|
||||
parallel plan for <command>INSERT</command>. The default is
|
||||
<literal>true</literal>. In cases such as when the table has a large
|
||||
number of partitions, and particularly also when that table uses a
|
||||
parallel-unsafe feature that prevents parallelism, the overhead of these
|
||||
checks may become prohibitively high. To address this potential overhead
|
||||
in these cases, this option can be used to disable the use of parallel
|
||||
insert for this table. Note that if the target table of the parallel
|
||||
insert is partitioned, the <literal>parallel_insert_enabled</literal>
|
||||
option values of the partitions are ignored.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="reloption-autovacuum-enabled" xreflabel="autovacuum_enabled">
|
||||
<term><literal>autovacuum_enabled</literal>, <literal>toast.autovacuum_enabled</literal> (<type>boolean</type>)
|
||||
<indexterm>
|
||||
|
Reference in New Issue
Block a user