Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode - Mailing list pgsql-committers

From Robert Haas
Subject Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Date
Msg-id CA+TgmoY0GdS7POPWB2nG3yiycNeLz05Mw53NunOjn8f8rZZuxw@mail.gmail.com
Whole thread Raw
In response to pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode  (Amit Kapila <akapila@postgresql.org>)
Responses Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
On Wed, Mar 17, 2021 at 10:14 PM Amit Kapila <akapila@postgresql.org> wrote:
> Add a new GUC and a reloption to enable inserts in parallel-mode.
>
> Commit 05c8482f7f added the implementation of parallel SELECT for
> "INSERT INTO ... SELECT ..." which may incur non-negligible overhead in
> the additional parallel-safety checks that it performs, even when, in the
> end, those checks determine that parallelism can't be used. This is
> normally only ever a problem in the case of when the target table has a
> large number of partitions.
>
> A new GUC option "enable_parallel_insert" is added, to allow insert in
> parallel-mode. The default is on.
>
> In addition to the GUC option, the user may want a mechanism to allow
> inserts in parallel-mode with finer granularity at table level. The new
> table option "parallel_insert_enabled" allows this. The default is true.

I find this fairly ugly. If you can't make the cost of checking
whether parallelism is safe low enough that you don't need a setting
for this, then I think perhaps you shouldn't have the feature at all.
In other words, I propose that you revert both this and 05c8482f7f and
come back when you have a better design that doesn't introduce so much
overhead.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix concurrency issues with WAL segment recycling on Windows
Next
From: Robert Haas
Date:
Subject: pgsql: More code cleanup for configurable TOAST compression.