Skip to content

Commit 41f12b0

Browse files
tenderwgCommitfest Bot
authored andcommitted
If we have a single hashclause, list_copy(hashclauses) is unnecessary. This adjustment can save the overhead of function calls and memory operation.
1 parent 1e9b514 commit 41f12b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/adt/selfuncs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3798,7 +3798,7 @@ estimate_multivariate_bucketsize(PlannerInfo *root, RelOptInfo *inner,
37983798
List *hashclauses,
37993799
Selectivity *innerbucketsize)
38003800
{
3801-
List *clauses = list_copy(hashclauses);
3801+
List *clauses;
38023802
List *otherclauses = NIL;
38033803
double ndistinct = 1.0;
38043804

@@ -3810,6 +3810,7 @@ estimate_multivariate_bucketsize(PlannerInfo *root, RelOptInfo *inner,
38103810
*/
38113811
return hashclauses;
38123812

3813+
clauses = list_copy(hashclauses);
38133814
while (clauses != NIL)
38143815
{
38153816
ListCell *lc;

0 commit comments

Comments
 (0)