@@ -123,12 +123,16 @@ pathman_join_pathlist_hook(PlannerInfo *root,
123
123
void
124
124
pathman_rel_pathlist_hook (PlannerInfo * root , RelOptInfo * rel , Index rti , RangeTblEntry * rte )
125
125
{
126
- PartRelationInfo * prel = NULL ;
127
- RelOptInfo * * new_rel_array ;
128
- RangeTblEntry * * new_rte_array ;
129
- int len ;
130
- bool found ;
131
- int first_child_relid = 0 ;
126
+ PartRelationInfo * prel = NULL ;
127
+ RangeTblEntry * * new_rte_array ;
128
+ RelOptInfo * * new_rel_array ;
129
+ bool found ;
130
+ int len ;
131
+ int first_child_relid = 0 ;
132
+
133
+ /* Invoke original hook if needed */
134
+ if (set_rel_pathlist_hook_next != NULL )
135
+ set_rel_pathlist_hook_next (root , rel , rti , rte );
132
136
133
137
if (!pg_pathman_enable )
134
138
return ;
@@ -262,6 +266,9 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
262
266
set_append_rel_pathlist (root , rel , rti , rte , pathkeyAsc , pathkeyDesc );
263
267
set_append_rel_size (root , rel , rti , rte );
264
268
269
+ if (!pg_pathman_enable_pickyappend )
270
+ return ;
271
+
265
272
foreach (lc , rel -> pathlist )
266
273
{
267
274
AppendPath * cur_path = (AppendPath * ) lfirst (lc );
@@ -277,7 +284,7 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
277
284
{
278
285
continue ;
279
286
}
280
-
287
+
281
288
foreach (subpath_cell , cur_path -> subpaths )
282
289
{
283
290
Path * subpath = (Path * ) lfirst (subpath_cell );
@@ -323,9 +330,4 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
323
330
add_path (rel , inner_path );
324
331
}
325
332
}
326
-
327
- /* Invoke original hook if needed */
328
- if (set_rel_pathlist_hook_next != NULL )
329
- set_rel_pathlist_hook_next (root , rel , rti , rte );
330
333
}
331
-
0 commit comments