From: Andrey V. Lepikhov <a.lepikhov@postgrespro.ru>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: etsuro.fujita@gmail.com
Cc: movead.li@highgo.ca
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Asynchronous Append on postgres_fdw nodes.
Date: Wed, 17 Jun 2020 15:01:08 +0500
Message-ID: <581520e2-1475-c614-b879-98b350220508@postgrespro.ru> (raw)
In-Reply-To: <20200616.173015.624761842205131449.horikyota.ntt@gmail.com>
References: <dc214e8f-96bc-a6c0-19ba-0dffc2051b34@postgrespro.ru>
<20200615.172934.587211238374081803.horikyota.ntt@gmail.com>
<3aa386ee-99d7-551f-85cf-c13b78947d4f@postgrespro.ru>
<20200616.173015.624761842205131449.horikyota.ntt@gmail.com>
On 6/16/20 1:30 PM, Kyotaro Horiguchi wrote:
> They return 25056 rows, which is far more than 9741 rows. So remote
> join won.
>
> Of course the number of returning rows is not the only factor of the
> cost change but is the most significant factor in this case.
>
Thanks for the attention.
I see one slight flaw of this approach to asynchronous append:
AsyncAppend works only for ForeignScan subplans. if we have
PartialAggregate, Join or another more complicated subplan, we can't use
asynchronous machinery.
It may lead to a situation than small difference in a filter constant
can cause a big difference in execution time.
I imagine an Append node, that can switch current subplan from time to
time and all ForeignScan nodes of the overall plan are added to one
queue. The scan buffer can be larger than a cursor fetch size and each
IterateForeignScan() call can induce asynchronous scan of another
ForeignScan node if buffer is not full.
But these are only thoughts, not an proposal. I have no questions to
your patch right now.
--
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: a.lepikhov@postgrespro.ru, horikyota.ntt@gmail.com, etsuro.fujita@gmail.com, movead.li@highgo.ca, pgsql-hackers@lists.postgresql.org
Subject: Re: Asynchronous Append on postgres_fdw nodes.
In-Reply-To: <581520e2-1475-c614-b879-98b350220508@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox