aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorEtsuro Fujita <efujita@postgresql.org>2021-04-23 12:00:00 +0900
committerEtsuro Fujita <efujita@postgresql.org>2021-04-23 12:00:00 +0900
commitbb684c82f73316b88f9bcb321128a4347b5206fe (patch)
tree510fc2a7ece07b3df91815242e857aa0d3974a4b /contrib/postgres_fdw/postgres_fdw.c
parentd479d00285255d422a2b38f1cfaa35808968a08c (diff)
downloadpostgresql-bb684c82f73316b88f9bcb321128a4347b5206fe.tar.gz
postgresql-bb684c82f73316b88f9bcb321128a4347b5206fe.zip
Minor code cleanup in asynchronous execution support.
This is cleanup for commit 27e1f1456: * ExecAppendAsyncEventWait(), which was modified a bit further by commit a8af856d3, duplicated the same nevents calculation. Simplify the code a little bit to avoid the duplication. Update comments there. * Add an assertion to ExecAppendAsyncRequest(). * Update a comment about merging the async_capable options from input relations in merge_fdw_options(), per complaint from Kyotaro Horiguchi. * Add a comment for fetch_more_data_begin(). Author: Etsuro Fujita Discussion: https://postgr.es/m/CAPmGK1637W30Wx3MnrReewhafn6F_0J76mrJGoFXFnpPq4QfvA%40mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index c590f374c67..e201b5404e6 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -5835,7 +5835,10 @@ merge_fdw_options(PgFdwRelationInfo *fpinfo,
/*
* We'll prefer to consider this join async-capable if any table from
- * either side of the join is considered async-capable.
+ * either side of the join is considered async-capable. This would be
+ * reasonable because in that case the foreign server would have its
+ * own resources to scan that table asynchronously, and the join could
+ * also be computed asynchronously using the resources.
*/
fpinfo->async_capable = fpinfo_o->async_capable ||
fpinfo_i->async_capable;
@@ -6893,6 +6896,9 @@ produce_tuple_asynchronously(AsyncRequest *areq, bool fetch)
/*
* Begin an asynchronous data fetch.
*
+ * Note: this function assumes there is no currently-in-progress asynchronous
+ * data fetch.
+ *
* Note: fetch_more_data must be called to fetch the result.
*/
static void