|
11 | 11 | * Portions Copyright (c) 1994, Regents of the University of California
|
12 | 12 | *
|
13 | 13 | * IDENTIFICATION
|
14 |
| - * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.70 2005/07/03 18:26:32 tgl Exp $ |
| 14 | + * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.71 2005/07/28 22:27:00 tgl Exp $ |
15 | 15 | *
|
16 | 16 | *-------------------------------------------------------------------------
|
17 | 17 | */
|
@@ -163,7 +163,7 @@ add_equijoined_keys(PlannerInfo *root, RestrictInfo *restrictinfo)
|
163 | 163 | newset=list_make2(item1,item2);
|
164 | 164 |
|
165 | 165 | /* Found a set to merge into our new set */
|
166 |
| -newset=list_union(newset,curset); |
| 166 | +newset=list_concat_unique(newset,curset); |
167 | 167 |
|
168 | 168 | /*
|
169 | 169 | * Remove old set from equi_key_list.
|
@@ -714,8 +714,7 @@ canonicalize_pathkeys(PlannerInfo *root, List *pathkeys)
|
714 | 714 | * canonicalized the keys, so that equivalent-key knowledge is
|
715 | 715 | * used when deciding if an item is redundant.
|
716 | 716 | */
|
717 |
| -if (!list_member_ptr(new_pathkeys,cpathkey)) |
718 |
| -new_pathkeys=lappend(new_pathkeys,cpathkey); |
| 717 | +new_pathkeys=list_append_unique_ptr(new_pathkeys,cpathkey); |
719 | 718 | }
|
720 | 719 | returnnew_pathkeys;
|
721 | 720 | }
|
@@ -1024,8 +1023,7 @@ build_index_pathkeys(PlannerInfo *root,
|
1024 | 1023 | * Eliminate redundant ordering info; could happen if query is
|
1025 | 1024 | * such that index keys are equijoined...
|
1026 | 1025 | */
|
1027 |
| -if (!list_member_ptr(retval,cpathkey)) |
1028 |
| -retval=lappend(retval,cpathkey); |
| 1026 | +retval=list_append_unique_ptr(retval,cpathkey); |
1029 | 1027 |
|
1030 | 1028 | indexkeys++;
|
1031 | 1029 | ordering++;
|
@@ -1467,8 +1465,7 @@ make_pathkeys_for_mergeclauses(PlannerInfo *root,
|
1467 | 1465 | * pathkey, a simple ptrMember test is sufficient to detect
|
1468 | 1466 | * redundant keys.
|
1469 | 1467 | */
|
1470 |
| -if (!list_member_ptr(pathkeys,pathkey)) |
1471 |
| -pathkeys=lappend(pathkeys,pathkey); |
| 1468 | +pathkeys=list_append_unique_ptr(pathkeys,pathkey); |
1472 | 1469 | }
|
1473 | 1470 |
|
1474 | 1471 | returnpathkeys;
|
|