Add a new GUC and a reloption to enable inserts in parallel-mode.
authorAmit Kapila <akapila@postgresql.org>
Thu, 18 Mar 2021 01:55:27 +0000 (07:25 +0530)
committerAmit Kapila <akapila@postgresql.org>
Thu, 18 Mar 2021 01:55:27 +0000 (07:25 +0530)
commitc8f78b616167bf8e24bc5dc69112c37755ed3058
tree71ba14ed3e7b3056581ef777f1675fba846ff64f
parent5f79580ad69f6e696365bdc63bc265f45bd77211
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
15 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/ref/alter_table.sgml
doc/src/sgml/ref/create_table.sgml
src/backend/access/common/reloptions.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/util/clauses.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/bin/psql/tab-complete.c
src/include/optimizer/cost.h
src/include/utils/rel.h
src/test/regress/expected/insert_parallel.out
src/test/regress/expected/sysviews.out
src/test/regress/sql/insert_parallel.sql
src/tools/pgindent/typedefs.list