postgresql/src/include/executor
Etsuro Fujita a363bc6da9 Fix EXPLAIN ANALYZE for async-capable nodes.
EXPLAIN ANALYZE for an async-capable ForeignScan node associated with
postgres_fdw is done just by using instrumentation for ExecProcNode()
called from the node's callbacks, causing the following problems:

1) If the remote table to scan is empty, the node is incorrectly
   considered as "never executed" by the command even if the node is
   executed, as ExecProcNode() isn't called from the node's callbacks at
   all in that case.
2) The command fails to collect timings for things other than
   ExecProcNode() done in the node, such as creating a cursor for the
   node's remote query.

To fix these problems, add instrumentation for async-capable nodes, and
modify postgres_fdw accordingly.

My oversight in commit 27e1f1456.

While at it, update a comment for the AsyncRequest struct in execnodes.h
and the documentation for the ForeignAsyncRequest API in fdwhandler.sgml
to match the code in ExecAsyncAppendResponse() in nodeAppend.c, and fix
typos in comments in nodeAppend.c.

Per report from Andrey Lepikhov, though I didn't use his patch.

Reviewed-by: Andrey Lepikhov
Discussion: https://postgr.es/m/2eb662bb-105d-fc20-7412-2f027cc3ca72%40postgrespro.ru
2021-05-12 14:00:00 +09:00
..
execAsync.h Add support for asynchronous execution. 2021-03-31 18:45:00 +09:00
execdebug.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execdesc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execExpr.h Redesign the caching done by get_cached_rowtype(). 2021-04-13 13:37:07 -04:00
execParallel.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execPartition.h Postpone some stuff out of ExecInitModifyTable. 2021-04-06 15:57:11 -04:00
executor.h Fix mishandling of resjunk columns in ON CONFLICT ... UPDATE tlists. 2021-05-10 11:02:29 -04:00
functions.h Undo decision to allow pg_proc.prosrc to be NULL. 2021-04-15 17:17:20 -04:00
hashjoin.h Revert "Fix race in Parallel Hash Join batch cleanup." 2021-03-18 01:10:55 +13:00
instrument.h Fix EXPLAIN ANALYZE for async-capable nodes. 2021-05-12 14:00:00 +09:00
nodeAgg.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeAppend.h Add support for asynchronous execution. 2021-03-31 18:45:00 +09:00
nodeBitmapAnd.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapHeapscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapIndexscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeBitmapOr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeCtescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeCustom.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeForeignscan.h Add support for asynchronous execution. 2021-03-31 18:45:00 +09:00
nodeFunctionscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGather.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGatherMerge.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeGroup.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeHash.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeHashjoin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIncrementalSort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIndexonlyscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeIndexscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeLimit.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeLockRows.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMaterial.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMergeAppend.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeMergejoin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeModifyTable.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeNamedtuplestorescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeNestloop.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeProjectSet.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeRecursiveunion.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeResult.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeResultCache.h Fix missing #include in nodeResultCache.h. 2021-04-06 11:23:56 -04:00
nodeSamplescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSeqscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSetOp.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSubplan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeSubqueryscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeTableFuncscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeTidrangescan.h Add TID Range Scans to support efficient scanning ranges of TIDs 2021-02-27 22:59:36 +13:00
nodeTidscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeUnique.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeValuesscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeWindowAgg.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodeWorktablescan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
spi.h Rethink recently-added SPI interfaces. 2021-01-26 16:37:12 -05:00
spi_priv.h Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
tablefunc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tqueue.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tstoreReceiver.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuptable.h Update copyright for 2021 2021-01-02 13:06:25 -05:00