Home Explore Blog CI



postgresql

7th chunk of `doc/src/sgml/postgres-fdw.sgml`
bbb9982e1de5dabfb694546ee67314f654e2e41cbd7daba90000000100000fbc
 <filename>postgres_fdw</filename>
       uses to connect to a remote server) limits the number of parameters in a
       single query to 65535. When the number of columns * <literal>batch_size</literal>
       exceeds the limit, the <literal>batch_size</literal> will be adjusted to
       avoid an error.
      </para>

      <para>
       This option also applies when copying into foreign tables.  In that case
       the actual number of rows <filename>postgres_fdw</filename> copies at
       once is determined in a similar way to the insert case, but it is
       limited to at most 1000 due to implementation restrictions of the
       <command>COPY</command> command.
      </para>
     </listitem>
    </varlistentry>

   </variablelist>

  </sect3>

  <sect3 id="postgres-fdw-options-asynchronous-execution">
   <title>Asynchronous Execution Options</title>

   <para>
    <filename>postgres_fdw</filename> supports asynchronous execution, which
    runs multiple parts of an <structname>Append</structname> node
    concurrently rather than serially to improve performance.
    This execution can be controlled using the following option:
   </para>

   <variablelist>

    <varlistentry>
     <term><literal>async_capable</literal> (<type>boolean</type>)</term>
     <listitem>
      <para>
       This option controls whether <filename>postgres_fdw</filename> allows
       foreign tables to be scanned concurrently for asynchronous execution.
       It can be specified for a foreign table or a foreign server.
       A table-level option overrides a server-level option.
       The default is <literal>false</literal>.
      </para>

      <para>
       In order to ensure that the data being returned from a foreign server
       is consistent, <filename>postgres_fdw</filename> will only open one
       connection for a given foreign server and will run all queries against
       that server sequentially even if there are multiple foreign tables
       involved, unless those tables are subject to different user mappings.
       In such a case, it may be more performant to disable this option to
       eliminate the overhead associated with running queries asynchronously.
      </para>

      <para>
       Asynchronous execution is applied even when an
       <structname>Append</structname> node contains subplan(s) executed
       synchronously as well as subplan(s) executed asynchronously.
       In such a case, if the asynchronous subplans are ones processed using
       <filename>postgres_fdw</filename>, tuples from the asynchronous
       subplans are not returned until after at least one synchronous subplan
       returns all tuples, as that subplan is executed while the asynchronous
       subplans are waiting for the results of asynchronous queries sent to
       foreign servers.
       This behavior might change in a future release.
      </para>
     </listitem>
    </varlistentry>

   </variablelist>
  </sect3>

  <sect3 id="postgres-fdw-options-transaction-management">
   <title>Transaction Management Options</title>

   <para>
    As described in the Transaction Management section, in
    <filename>postgres_fdw</filename> transactions are managed by creating
    corresponding remote transactions, and subtransactions are managed by
    creating corresponding remote subtransactions. When multiple remote
    transactions are involved in the current local transaction, by default
    <filename>postgres_fdw</filename> commits or aborts those remote
    transactions serially when the local transaction is committed or aborted.
    When multiple remote subtransactions are involved in the current local
    subtransaction, by default <filename>postgres_fdw</filename> commits or
    aborts those remote subtransactions serially when the local subtransaction
    is committed or aborted.
    Performance can be improved with the following options:
   </para>

   <variablelist>

    <varlistentry>
     <term><literal>parallel_commit</literal> (<type>boolean</type>)</term>

Title: Postgres FDW Asynchronous Execution and Transaction Management Options
Summary
The postgres_fdw foreign data wrapper provides options to control asynchronous execution, including the async_capable option to enable concurrent scanning of foreign tables, and transaction management options, such as parallel_commit, to improve performance by committing or aborting remote transactions in parallel.