diff options
Diffstat (limited to 'src/backend/optimizer/path')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 13 | ||||
-rw-r--r-- | src/backend/optimizer/path/costsize.c | 3 | ||||
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 18 |
3 files changed, 13 insertions, 21 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index e9ee32b7f43..db3a68a51dd 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -1266,7 +1266,7 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, if (rel->part_scheme) rel->partitioned_child_rels = list_concat(rel->partitioned_child_rels, - list_copy(childrel->partitioned_child_rels)); + childrel->partitioned_child_rels); /* * Child is live, so add it to the live_childrels list for use below. @@ -1347,9 +1347,8 @@ add_paths_to_append_rel(PlannerInfo *root, RelOptInfo *rel, component = root->simple_rel_array[relid]; Assert(component->part_scheme != NULL); Assert(list_length(component->partitioned_child_rels) >= 1); - partrels = - list_concat(partrels, - list_copy(component->partitioned_child_rels)); + partrels = list_concat(partrels, + component->partitioned_child_rels); } partitioned_rels = list_make1(partrels); @@ -2048,8 +2047,7 @@ accumulate_append_subpath(Path *path, List **subpaths, List **special_subpaths) if (!apath->path.parallel_aware || apath->first_partial_path == 0) { - /* list_copy is important here to avoid sharing list substructure */ - *subpaths = list_concat(*subpaths, list_copy(apath->subpaths)); + *subpaths = list_concat(*subpaths, apath->subpaths); return; } else if (special_subpaths != NULL) @@ -2072,8 +2070,7 @@ accumulate_append_subpath(Path *path, List **subpaths, List **special_subpaths) { MergeAppendPath *mpath = (MergeAppendPath *) path; - /* list_copy is important here to avoid sharing list substructure */ - *subpaths = list_concat(*subpaths, list_copy(mpath->subpaths)); + *subpaths = list_concat(*subpaths, mpath->subpaths); return; } diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 3a9a994733b..bc6bc999573 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -4443,8 +4443,7 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel, * restriction clauses. Note that we force the clauses to be treated as * non-join clauses during selectivity estimation. */ - allclauses = list_concat(list_copy(param_clauses), - rel->baserestrictinfo); + allclauses = list_concat_copy(param_clauses, rel->baserestrictinfo); nrows = rel->tuples * clauselist_selectivity(root, allclauses, diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 5f339fdfde7..37b257cd0e9 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -656,7 +656,7 @@ get_join_index_paths(PlannerInfo *root, RelOptInfo *rel, } } - /* Add restriction clauses (this is nondestructive to rclauseset) */ + /* Add restriction clauses */ clauseset.indexclauses[indexcol] = list_concat(clauseset.indexclauses[indexcol], rclauseset->indexclauses[indexcol]); @@ -1204,8 +1204,7 @@ build_paths_for_OR(PlannerInfo *root, RelOptInfo *rel, { /* Form all_clauses if not done already */ if (all_clauses == NIL) - all_clauses = list_concat(list_copy(clauses), - other_clauses); + all_clauses = list_concat_copy(clauses, other_clauses); if (!predicate_implied_by(index->indpred, all_clauses, false)) continue; /* can't use it at all */ @@ -1270,7 +1269,7 @@ generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, * We can use both the current and other clauses as context for * build_paths_for_OR; no need to remove ORs from the lists. */ - all_clauses = list_concat(list_copy(clauses), other_clauses); + all_clauses = list_concat_copy(clauses, other_clauses); foreach(lc, clauses) { @@ -1506,8 +1505,7 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths) pathinfo = pathinfoarray[i]; paths = list_make1(pathinfo->path); costsofar = bitmap_scan_cost_est(root, rel, pathinfo->path); - qualsofar = list_concat(list_copy(pathinfo->quals), - list_copy(pathinfo->preds)); + qualsofar = list_concat_copy(pathinfo->quals, pathinfo->preds); clauseidsofar = bms_copy(pathinfo->clauseids); for (j = i + 1; j < npaths; j++) @@ -1543,10 +1541,8 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths) { /* keep new path in paths, update subsidiary variables */ costsofar = newcost; - qualsofar = list_concat(qualsofar, - list_copy(pathinfo->quals)); - qualsofar = list_concat(qualsofar, - list_copy(pathinfo->preds)); + qualsofar = list_concat(qualsofar, pathinfo->quals); + qualsofar = list_concat(qualsofar, pathinfo->preds); clauseidsofar = bms_add_members(clauseidsofar, pathinfo->clauseids); } @@ -1849,7 +1845,7 @@ find_indexpath_quals(Path *bitmapqual, List **quals, List **preds) *quals = lappend(*quals, iclause->rinfo->clause); } - *preds = list_concat(*preds, list_copy(ipath->indexinfo->indpred)); + *preds = list_concat(*preds, ipath->indexinfo->indpred); } else elog(ERROR, "unrecognized node type: %d", nodeTag(bitmapqual)); |