aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-07-06 18:10:11 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-07-06 18:10:20 -0400
commit955b3e0f9269639fb916cee3dea37aee50b82df0 (patch)
tree395cf4010f26d0e3f2383f9ad724cb683135acce /doc/src
parent5798ca529935698ab976780565fb2b4d8d34d810 (diff)
downloadpostgresql-955b3e0f9269639fb916cee3dea37aee50b82df0.tar.gz
postgresql-955b3e0f9269639fb916cee3dea37aee50b82df0.zip
Allow CustomScan providers to say whether they support projections.
Previously, all CustomScan providers had to support projections, but there may be cases where this is inconvenient. Add a flag bit to say if it's supported. Important item for the release notes: this is non-backwards-compatible since the default is now to assume that CustomScan providers can't project, instead of assuming that they can. It's fail-soft, but could result in visible performance penalties due to adding unnecessary Result nodes. Sven Klemm, reviewed by Aleksander Alekseev; some cosmetic fiddling by me. Discussion: https://postgr.es/m/CAMCrgp1kyakOz6c8aKhNDJXjhQ1dEjEnp+6KNT3KxPrjNtsrDg@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/custom-scan.sgml13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/src/sgml/custom-scan.sgml b/doc/src/sgml/custom-scan.sgml
index 239ba29de72..93d96f2f566 100644
--- a/doc/src/sgml/custom-scan.sgml
+++ b/doc/src/sgml/custom-scan.sgml
@@ -71,10 +71,17 @@ typedef struct CustomPath
<para>
<structfield>path</structfield> must be initialized as for any other path, including
the row-count estimate, start and total cost, and sort ordering provided
- by this path. <structfield>flags</structfield> is a bit mask, which should include
+ by this path. <structfield>flags</structfield> is a bit mask, which
+ specifies whether the scan provider can support certain optional
+ capabilities. <structfield>flags</structfield> should include
<literal>CUSTOMPATH_SUPPORT_BACKWARD_SCAN</literal> if the custom path can support
- a backward scan and <literal>CUSTOMPATH_SUPPORT_MARK_RESTORE</literal> if it
- can support mark and restore. Both capabilities are optional.
+ a backward scan, <literal>CUSTOMPATH_SUPPORT_MARK_RESTORE</literal> if it
+ can support mark and restore,
+ and <literal>CUSTOMPATH_SUPPORT_PROJECTION</literal> if it can perform
+ projections. (If <literal>CUSTOMPATH_SUPPORT_PROJECTION</literal> is not
+ set, the scan node will only be asked to produce Vars of the scanned
+ relation; while if that flag is set, the scan node must be able to
+ evaluate scalar expressions over these Vars.)
An optional <structfield>custom_paths</structfield> is a list of <structname>Path</structname>
nodes used by this custom-path node; these will be transformed into
<structname>Plan</structname> nodes by planner.