Re: Asynchronous Append on postgres_fdw nodes.

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Asynchronous Append on postgres_fdw nodes.
Date: 2021-04-27 12:31:08
Message-ID: CAPmGK146cxSJyfM4Xv2jGTsF0ghmPEtwA7dS5_4cKo1oF6+ipw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 26, 2021 at 7:35 PM Andrey V. Lepikhov
<a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
> Small mistake i found. If no tuple was received from a foreign
> partition, explain shows that we never executed node. For example,
> if we have 0 tuples in f1 and 100 tuples in f2:
>
> Query:
> EXPLAIN (ANALYZE, VERBOSE, TIMING OFF, COSTS OFF)
> SELECT * FROM (SELECT * FROM f1 UNION ALL SELECT * FROM f2) AS q1
> LIMIT 101;
>
> Explain:
> Limit (actual rows=100 loops=1)
> Output: f1.a
> -> Append (actual rows=100 loops=1)
> -> Async Foreign Scan on public.f1 (never executed)
> Output: f1.a
> Remote SQL: SELECT a FROM public.l1
> -> Async Foreign Scan on public.f2 (actual rows=100 loops=1)
> Output: f2.a
> Remote SQL: SELECT a FROM public.l2
>
> The patch in the attachment fixes this.

Thanks for the report and patch! Will look into this.

Best regards,
Etsuro Fujita

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-04-27 12:33:36 Re: [PATCH] Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids
Previous Message Etsuro Fujita 2021-04-27 12:27:05 Re: Asynchronous Append on postgres_fdw nodes.