Re: Asynchronous Append on postgres_fdw nodes.

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, "movead(dot)li" <movead(dot)li(at)highgo(dot)ca>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Asynchronous Append on postgres_fdw nodes.
Date: 2021-03-08 05:30:40
Message-ID: CAPmGK15i-OyCesd369P8zyBErjN_T18zVYu27714bf_L=COXew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 17, 2020 at 6:56 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
> * I haven't yet added some planner/resowner changes from Horiguchi-san's patch.

The patch in [1] allocates, populates, frees a wait event set every
time when doing ExecAppendAsyncEventWait(), so it wouldn’t leak wait
event sets. Actually, we don’t need the ResourceOwner change?

I thought the change to cost_append() proposed in his patch would be a
good idea, but I noticed this:

+ /*
+ * It's not obvious how to determine the total cost of
+ * async subnodes. Although it is not always true, we
+ * assume it is the maximum cost among all async subnodes.
+ */
+ if (async_max_cost < subpath->total_cost)
+ async_max_cost = subpath->total_cost;

As commented, the assumption isn’t always correct (a counter-example
would be the case where all async subnodes use the same connection as
shown in [2]). Rather than modifying that function as proposed, I
feel inclined to leave that function as-is.

Best regards,
Etsuro Fujita

[1] https://www.postgresql.org/message-id/CAPmGK14wcXKqGDpYRieA1ETgyj%2BEp5ntrGVD%3D29iESoQYUx9YQ%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CAPmGK17Ap6AGTFrtn3%3D%3DPsVfHUkuiRPFXZqXSQ%3DXWQDtDbNNBQ%40mail.gmail.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-03-08 05:32:45 Re: a verbose option for autovacuum
Previous Message Amit Langote 2021-03-08 05:27:39 Re: Huge memory consumption on partitioned table with FKs