From f1f01de145d0aaca80e6cf8b2ccb7e7f4ed1ad02 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 12 Apr 2016 15:23:14 -0400 Subject: 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. --- src/backend/optimizer/prep/prepunion.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/backend/optimizer/prep/prepunion.c') 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; -- cgit v1.2.3