pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Date: Thu, 18 Mar 2021 02:14:27 +0000
Message-ID: <E1lMiB9-0001c3-SY@gemulon.postgresql.org> (raw)

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.

Author: "Hou, Zhijie"
Reviewed-by: Greg Nancarrow, Amit Langote, Takayuki Tsunakawa, Amit Kapila
Discussion: https://postgr.es/m/CAA4eK1K-cW7svLC2D7DHoGHxdAdg3P37BLgebqBOC2ZLc9a6QQ%40mail.gmail.com
Discussion: https://postgr.es/m/CAJcOf-cXnB5cnMKqWEp2E2z7Mvcd04iLVmV=qpFJrR3AcrTS3g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c8f78b616167bf8e24bc5dc69112c37755ed3058

Modified Files
--------------
doc/src/sgml/config.sgml                      | 23 +++++++++++
doc/src/sgml/ref/alter_table.sgml             |  3 +-
doc/src/sgml/ref/create_table.sgml            | 26 +++++++++++++
src/backend/access/common/reloptions.c        | 25 +++++++++---
src/backend/optimizer/path/costsize.c         |  2 +
src/backend/optimizer/util/clauses.c          | 34 ++++++++++++++--
src/backend/utils/misc/guc.c                  | 10 +++++
src/backend/utils/misc/postgresql.conf.sample |  1 +
src/bin/psql/tab-complete.c                   |  1 +
src/include/optimizer/cost.h                  |  1 +
src/include/utils/rel.h                       | 25 ++++++++++++
src/test/regress/expected/insert_parallel.out | 56 ++++++++++++++++++++++++++-
src/test/regress/expected/sysviews.out        |  3 +-
src/test/regress/sql/insert_parallel.sql      | 44 ++++++++++++++++++++-
src/tools/pgindent/typedefs.list              |  1 +
15 files changed, 240 insertions(+), 15 deletions(-)



view thread (37+ messages)  latest in thread

Message-ID: <E1lMiB9-0001c3-SY@gemulon.postgresql.org>
Permalink:  ../E1lMiB9-0001c3-SY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lMiB9-0001c3-SY@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
  In-Reply-To: <E1lMiB9-0001c3-SY@gemulon.postgresql.org>
  References: <E1lMiB9-0001c3-SY@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox