@@ -79,7 +79,7 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
79
79
List * inner_sel = NIL ;
80
80
List * outer ;
81
81
List * outer_sel = NIL ;
82
- List * cur ;
82
+ List * cur = NIL ;
83
83
List * cur_sel = NIL ;
84
84
85
85
Assert (selectivities != NULL );
@@ -160,6 +160,32 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
160
160
return get_path_clauses (((LimitPath * ) path )-> subpath , root ,
161
161
selectivities );
162
162
break ;
163
+ case T_SubqueryScanPath :
164
+ return get_path_clauses (((SubqueryScanPath * ) path )-> subpath , root ,
165
+ selectivities );
166
+ break ;
167
+ case T_AppendPath :
168
+ {
169
+ ListCell * lc ;
170
+
171
+ foreach (lc , ((AppendPath * ) path )-> subpaths )
172
+ {
173
+ Path * subpath = lfirst (lc );
174
+
175
+ cur = list_concat (cur , list_copy (
176
+ get_path_clauses (subpath , root , selectivities )));
177
+ cur_sel = list_concat (cur_sel , * selectivities );
178
+ }
179
+ cur = list_concat (cur , list_copy (path -> parent -> baserestrictinfo ));
180
+ * selectivities = list_concat (cur_sel ,
181
+ get_selectivities (root ,
182
+ path -> parent -> baserestrictinfo ,
183
+ 0 , JOIN_INNER , NULL ));
184
+ return cur ;
185
+ }
186
+ break ;
187
+ case T_ForeignPath :
188
+ /* The same as in the default case */
163
189
default :
164
190
cur = list_concat (list_copy (path -> parent -> baserestrictinfo ),
165
191
path -> param_info ?
0 commit comments