Re: Asynchronous Append on postgres_fdw nodes.
Andrei Lepikhov <a.lepikhov@postgrespro.ru>
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
Justin Pryzby <pryzby@telsasoft.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-05-07T10:32:47Z
Lists: pgsql-hackers
Attachments
- t1.sql (application/sql)
On 6/5/21 11:45, Etsuro Fujita wrote: > On Tue, Apr 27, 2021 at 9:31 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote: > The patch fixes the issue, but I don’t think it’s the right way to go, > because it requires an extra ExecProcNode() call, which wouldn’t be > efficient. Also, the patch wouldn’t address another issue I noticed > in EXPLAIN ANALYZE for async-capable nodes that the command wouldn’t > measure the time spent in such nodes accurately. For the case of > async-capable node using postgres_fdw, it only measures the time spent > in ExecProcNode() in ExecAsyncRequest()/ExecAsyncNotify(), missing the > time spent in other things such as creating a cursor in > ExecAsyncRequest(). :-(. To address both issues, I’d like to propose > the attached, in which I added instrumentation support to > ExecAsyncRequest()/ExecAsyncConfigureWait()/ExecAsyncNotify(). I > think this would not only address the reported issue more efficiently, > but allow to collect timing for async-capable nodes more accurately. Ok, I agree with the approach, but the next test case failed: EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) SELECT * FROM ( (SELECT * FROM f1) UNION ALL (SELECT * FROM f2) ) q1 LIMIT 100; ERROR: InstrUpdateTupleCount called on node not yet executed Initialization script see in attachment. -- regards, Andrey Lepikhov Postgres Professional
Commits
-
Improve comments for trivial_subqueryscan().
- 4a8a5dd7f59c 15.0 landed
-
Disable asynchronous execution if using gating Result nodes.
- ebb790241523 14.3 landed
- 5c854e7a2c8a 15.0 landed
-
Allow asynchronous execution in more cases.
- c2bb02bc2e85 15.0 landed
-
Doc: Further update documentation for asynchronous execution.
- eab81953682d 14.0 landed
-
Fix rescanning of async-aware Append nodes.
- f3baaf28a6da 14.0 landed
-
Doc: Update documentation for asynchronous execution.
- 15fcd33e0694 14.0 landed
-
Fix EXPLAIN ANALYZE for async-capable nodes.
- a363bc6da96b 14.0 landed
-
Minor code cleanup in asynchronous execution support.
- bb684c82f733 14.0 landed
-
Adjust input value to WaitEventSetWait() in ExecAppendAsyncEventWait().
- a8af856d3257 14.0 landed
-
Add support for asynchronous execution.
- 27e1f14563cf 14.0 landed