Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28c60fe

Browse files
committed
move next hook call in rel_pathlist_hook, check for the enable_pickyappend flag
1 parent 7e7210c commit 28c60fe

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

hooks.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,16 @@ pathman_join_pathlist_hook(PlannerInfo *root,
123123
void
124124
pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte)
125125
{
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);
132136

133137
if (!pg_pathman_enable)
134138
return;
@@ -262,6 +266,9 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
262266
set_append_rel_pathlist(root, rel, rti, rte, pathkeyAsc, pathkeyDesc);
263267
set_append_rel_size(root, rel, rti, rte);
264268

269+
if (!pg_pathman_enable_pickyappend)
270+
return;
271+
265272
foreach (lc, rel->pathlist)
266273
{
267274
AppendPath *cur_path = (AppendPath *) lfirst(lc);
@@ -277,7 +284,7 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
277284
{
278285
continue;
279286
}
280-
287+
281288
foreach (subpath_cell, cur_path->subpaths)
282289
{
283290
Path *subpath = (Path *) lfirst(subpath_cell);
@@ -323,9 +330,4 @@ pathman_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTb
323330
add_path(rel, inner_path);
324331
}
325332
}
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);
330333
}
331-

0 commit comments

Comments
 (0)