aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-02-09 11:41:09 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-02-09 11:41:09 -0500
commit6401583863eaf83624994908911350b03f9978ae (patch)
treead1814d3e280e8abea4c43d1537a937ce2c85acc /doc/src
parent4446565d36ac4482282146a9ab35068f18dff4fd (diff)
downloadpostgresql-6401583863eaf83624994908911350b03f9978ae.tar.gz
postgresql-6401583863eaf83624994908911350b03f9978ae.zip
Call set_rel_pathlist_hook before generate_gather_paths, not after.
The previous ordering of these steps satisfied the nominal requirement that set_rel_pathlist_hook could editorialize on the whole set of Paths constructed for a base relation. In practice, though, trying to change the set of partial paths was impossible. Adding one didn't work because (a) it was too late to be included in Gather paths made by the core code, and (b) calling add_partial_path after generate_gather_paths is unsafe, because it might try to delete a path it thinks is dominated, but that is already embedded in some Gather path(s). Nor could the hook safely remove partial paths, for the same reason that they might already be embedded in Gathers. Better to call extensions first, let them add partial paths as desired, and then gather. In v11 and up, we already doubled down on that ordering by postponing gathering even further for single-relation queries; so even if the hook wished to editorialize on Gather path construction, it could not. Report and patch by KaiGai Kohei. Back-patch to 9.6 where Gather paths were added. Discussion: https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/custom-scan.sgml5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/src/sgml/custom-scan.sgml b/doc/src/sgml/custom-scan.sgml
index 24631f5f404..ab9b055d9a9 100644
--- a/doc/src/sgml/custom-scan.sgml
+++ b/doc/src/sgml/custom-scan.sgml
@@ -37,8 +37,9 @@
<para>
A custom scan provider will typically add paths for a base relation by
setting the following hook, which is called after the core code has
- generated what it believes to be the complete and correct set of access
- paths for the relation.
+ generated all the access paths it can for the relation (except for
+ Gather paths, which are made after this call so that they can use
+ partial paths added by the hook):
<programlisting>
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root,
RelOptInfo *rel,