Re: postgres_fdw "parallel_commit" docs

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw "parallel_commit" docs
Date: 2022-05-12 11:26:03
Message-ID: CAPmGK16ukoVRrkLdqUuZ1iafQcDteSKty7xB927O4xgNoLUyPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 11, 2022 at 7:25 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
> One thing I noticed is this bit:
>
> - 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:
> + When multiple remote transactions or subtransactions are involved in a
> + local transaction (or subtransaction) on a foreign server,
> + <filename>postgres_fdw</filename> by default commits those remote
> + transactions serially when the local transaction commits.
> Performance can be
> + improved with the following option:
>
> I think this might still be a bit confusing. How about rewriting it
> to something like this?
>
> As described in F.38.4. Transaction Management, in postgres_fdw
> 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,
> postgres_fdw by default commits those remote transactions serially
> when the local transaction is committed. When multiple remote
> subtransactions are involved in the current local subtransaction, it
> by default commits those remote subtransactions serially when the
> local subtransaction is committed. Performance can be improved with
> the following option:
>
> It might be a bit redundant to explain the transaction/subtransaction
> cases differently, but I think it makes it clear and maybe
> easy-to-understand that how they are handled by postgres_fdw by
> default.

I modified the patch that way.

On Wed, May 11, 2022 at 7:29 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
> On Tue, May 10, 2022 at 12:58 AM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> > On Mon, May 09, 2022 at 11:37:35AM -0400, Jonathan S. Katz wrote:
> > > - 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.
> > > + If multiple foreign servers with this option enabled have a local
> > > + transaction, multiple remote transactions on those foreign servers are
> > > + committed in parallel across those foreign servers when the local
> > > + transaction is committed.
> > > </para>
> >
> > I think "have a transaction" doesn't sound good, and the old language "involved
> > in" was better.
>
> I think so too.

I modified the patch to use the old language. Also, I fixed a typo
reported by Justin.

Attached is an updated patch. I'll commit the patch if no objections.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
parallel-commit-docs-efujita.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajin Cherian 2022-05-12 11:32:48 Re: First draft of the PG 15 release notes
Previous Message Amit Kapila 2022-05-12 11:10:49 Re: First draft of the PG 15 release notes