1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

postgres_fdw: Add support for parallel commit.

postgres_fdw commits remote (sub)transactions opened on remote server(s)
in a local (sub)transaction one by one when the local (sub)transaction
commits.  This patch allows it to commit the remote (sub)transactions in
parallel to improve performance.  This is enabled by the server option
"parallel_commit".  The default is false.

Etsuro Fujita, reviewed by Fujii Masao and David Zhang.

Discussion: http://postgr.es/m/CAPmGK17dAZCXvwnfpr1eTfknTGdt%3DhYTV9405Gt5SqPOX8K84w%40mail.gmail.com
This commit is contained in:
Etsuro Fujita
2022-02-24 14:30:00 +09:00
parent cfb4e209ec
commit 04e706d423
5 changed files with 376 additions and 19 deletions

View File

@ -456,6 +456,52 @@ OPTIONS (ADD password_required 'false');
</variablelist>
</sect3>
<sect3>
<title>Transaction Management Options</title>
<para>
When multiple remote (sub)transactions are involved in a local
(sub)transaction, by default <filename>postgres_fdw</filename> commits
those remote (sub)transactions one by one when the local (sub)transaction
commits.
Performance can be improved with the following option:
</para>
<variablelist>
<varlistentry>
<term><literal>parallel_commit</literal> (<type>boolean</type>)</term>
<listitem>
<para>
This option controls whether <filename>postgres_fdw</filename> commits
remote (sub)transactions opened on a foreign server in a local
(sub)transaction in parallel when the local (sub)transaction commits.
This option can only be specified for foreign servers, not per-table.
The default is <literal>false</literal>.
</para>
<para>
If multiple foreign servers with this option enabled are involved in
a local (sub)transaction, multiple remote (sub)transactions opened on
those foreign servers in the local (sub)transaction are committed in
parallel across those foreign servers when the local (sub)transaction
commits.
</para>
<para>
For a foreign server with this option enabled, if many remote
(sub)transactions are opened on the foreign server in a local
(sub)transaction, this option might increase the remote servers load
when the local (sub)transaction commits, so be careful when using this
option.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>
<sect3>
<title>Updatability Options</title>