aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/path/allpaths.c9
-rw-r--r--src/backend/optimizer/path/indxpath.c14
-rw-r--r--src/backend/optimizer/path/pathkeys.c2
-rw-r--r--src/backend/optimizer/plan/createplan.c5
4 files changed, 13 insertions, 17 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index e9342097e52..358bb2aed6f 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -2053,9 +2053,8 @@ accumulate_append_subpath(Path *path, List **subpaths, List **special_subpaths)
*subpaths = list_concat(*subpaths,
list_copy_tail(apath->subpaths,
apath->first_partial_path));
- new_special_subpaths =
- list_truncate(list_copy(apath->subpaths),
- apath->first_partial_path);
+ new_special_subpaths = list_copy_head(apath->subpaths,
+ apath->first_partial_path);
*special_subpaths = list_concat(*special_subpaths,
new_special_subpaths);
return;
@@ -3086,8 +3085,8 @@ get_useful_pathkeys_for_relation(PlannerInfo *root, RelOptInfo *rel,
root->query_pathkeys);
else if (npathkeys > 0)
useful_pathkeys_list = lappend(useful_pathkeys_list,
- list_truncate(list_copy(root->query_pathkeys),
- npathkeys));
+ list_copy_head(root->query_pathkeys,
+ npathkeys));
}
return useful_pathkeys_list;
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 0ef70ad7f11..7d176e7b00a 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -3026,14 +3026,12 @@ expand_indexqual_rowcompare(PlannerInfo *root,
rc->rctype = (RowCompareType) op_strategy;
rc->opnos = new_ops;
- rc->opfamilies = list_truncate(list_copy(clause->opfamilies),
- matching_cols);
- rc->inputcollids = list_truncate(list_copy(clause->inputcollids),
- matching_cols);
- rc->largs = list_truncate(copyObject(var_args),
- matching_cols);
- rc->rargs = list_truncate(copyObject(non_var_args),
- matching_cols);
+ rc->opfamilies = list_copy_head(clause->opfamilies,
+ matching_cols);
+ rc->inputcollids = list_copy_head(clause->inputcollids,
+ matching_cols);
+ rc->largs = list_copy_head(var_args, matching_cols);
+ rc->rargs = list_copy_head(non_var_args, matching_cols);
iclause->indexquals = list_make1(make_simple_restrictinfo(root,
(Expr *) rc));
}
diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c
index 985b5d8de9b..b5d6c977eef 100644
--- a/src/backend/optimizer/path/pathkeys.c
+++ b/src/backend/optimizer/path/pathkeys.c
@@ -2464,7 +2464,7 @@ truncate_useless_pathkeys(PlannerInfo *root,
else if (nuseful == list_length(pathkeys))
return pathkeys;
else
- return list_truncate(list_copy(pathkeys), nuseful);
+ return list_copy_head(pathkeys, nuseful);
}
/*
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 76606faa3e4..e37f2933eb8 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -1397,8 +1397,7 @@ create_append_plan(PlannerInfo *root, AppendPath *best_path, int flags)
*/
if (tlist_was_changed && (flags & (CP_EXACT_TLIST | CP_SMALL_TLIST)))
{
- tlist = list_truncate(list_copy(plan->plan.targetlist),
- orig_tlist_length);
+ tlist = list_copy_head(plan->plan.targetlist, orig_tlist_length);
return inject_projection_plan((Plan *) plan, tlist,
plan->plan.parallel_safe);
}
@@ -1557,7 +1556,7 @@ create_merge_append_plan(PlannerInfo *root, MergeAppendPath *best_path,
*/
if (tlist_was_changed && (flags & (CP_EXACT_TLIST | CP_SMALL_TLIST)))
{
- tlist = list_truncate(list_copy(plan->targetlist), orig_tlist_length);
+ tlist = list_copy_head(plan->targetlist, orig_tlist_length);
return inject_projection_plan(plan, tlist, plan->parallel_safe);
}
else