File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 28
28
#include "utils/lsyscache.h"
29
29
30
30
31
+ /* Borrowed from joinpath.c */
32
+ #define PATH_PARAM_BY_REL (path , rel ) \
33
+ ((path)->param_info && bms_overlap(PATH_REQ_OUTER(path), (rel)->relids))
34
+
35
+
31
36
set_join_pathlist_hook_type set_join_pathlist_next = NULL ;
32
37
set_rel_pathlist_hook_type set_rel_pathlist_hook_next = NULL ;
33
38
planner_hook_type planner_hook_next = NULL ;
@@ -123,6 +128,12 @@ pathman_join_pathlist_hook(PlannerInfo *root,
123
128
124
129
/* Select cheapest path for outerrel */
125
130
outer = outerrel -> cheapest_total_path ;
131
+
132
+ /* We cannot use an outer path that is parameterized by the inner rel */
133
+ if (PATH_PARAM_BY_REL (outer , innerrel ))
134
+ continue ;
135
+
136
+ /* Wrap 'outer' in unique path if needed */
126
137
if (saved_jointype == JOIN_UNIQUE_OUTER )
127
138
{
128
139
outer = (Path * ) create_unique_path (root , outerrel ,
You can’t perform that action at this time.
0 commit comments