diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-12 15:23:14 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-12 15:23:14 -0400 |
commit | f1f01de145d0aaca80e6cf8b2ccb7e7f4ed1ad02 (patch) | |
tree | 8dce0baf20ce16f6ac6def671c6df9b4acc67782 /src/backend/optimizer/prep/prepunion.c | |
parent | 7a5f8b5c59033ac153963f98b9109be9529a824a (diff) |
Redefine create_upper_paths_hook as being invoked once per upper relation.
Per discussion, this gives potential users of the hook more flexibility,
because they can build custom Paths that implement only one stage of
upper processing atop core-provided Paths for earlier stages.
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
-rw-r--r-- | src/backend/optimizer/prep/prepunion.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index a1ab4daf11a..552b756b8b1 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -206,7 +206,12 @@ plan_set_operations(PlannerInfo *root) /* Add only the final path to the SETOP upperrel. */ add_path(setop_rel, path); - /* Select cheapest path (pretty easy at the moment) */ + /* Let extensions possibly add some more paths */ + if (create_upper_paths_hook) + (*create_upper_paths_hook) (root, UPPERREL_SETOP, + NULL, setop_rel); + + /* Select cheapest path */ set_cheapest(setop_rel); return setop_rel; |