|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.171 2004/05/30 23:40:28 neilc Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.172 2004/06/01 03:02:57 tgl Exp $ |
14 | 14 | *
|
15 | 15 | *-------------------------------------------------------------------------
|
16 | 16 | */
|
@@ -261,20 +261,19 @@ create_scan_plan(Query *root, Path *best_path)
|
261 | 261 | static List *
|
262 | 262 | build_relation_tlist(RelOptInfo *rel)
|
263 | 263 | {
|
264 |
| - FastList tlist; |
| 264 | + List *tlist = NIL; |
265 | 265 | int resdomno = 1;
|
266 | 266 | ListCell *v;
|
267 | 267 |
|
268 |
| - FastListInit(&tlist); |
269 |
| - foreach(v, FastListValue(&rel->reltargetlist)) |
| 268 | + foreach(v, rel->reltargetlist) |
270 | 269 | {
|
271 | 270 | /* Do we really need to copy here? Not sure */
|
272 | 271 | Var *var = (Var *) copyObject(lfirst(v));
|
273 | 272 |
|
274 |
| - FastAppend(&tlist, create_tl_element(var, resdomno)); |
| 273 | + tlist = lappend(tlist, create_tl_element(var, resdomno)); |
275 | 274 | resdomno++;
|
276 | 275 | }
|
277 |
| - return FastListValue(&tlist); |
| 276 | + return tlist; |
278 | 277 | }
|
279 | 278 |
|
280 | 279 | /*
|
@@ -701,7 +700,7 @@ create_indexscan_plan(Query *root,
|
701 | 700 | List *indxstrategy;
|
702 | 701 | List *indxsubtype;
|
703 | 702 | List *indxlossy;
|
704 |
| - FastList indexids; |
| 703 | + List *indexids; |
705 | 704 | ListCell *l;
|
706 | 705 | IndexScan *scan_plan;
|
707 | 706 |
|
@@ -737,12 +736,12 @@ create_indexscan_plan(Query *root,
|
737 | 736 | scan_clauses = order_qual_clauses(root, scan_clauses);
|
738 | 737 |
|
739 | 738 | /* Build list of index OIDs */
|
740 |
| - FastListInit(&indexids); |
| 739 | + indexids = NIL; |
741 | 740 | foreach(l, best_path->indexinfo)
|
742 | 741 | {
|
743 | 742 | IndexOptInfo *index = (IndexOptInfo *) lfirst(l);
|
744 | 743 |
|
745 |
| - FastAppendo(&indexids, index->indexoid); |
| 744 | + indexids = lappend_oid(indexids, index->indexoid); |
746 | 745 | }
|
747 | 746 |
|
748 | 747 | /*
|
@@ -801,7 +800,7 @@ create_indexscan_plan(Query *root,
|
801 | 800 | scan_plan = make_indexscan(tlist,
|
802 | 801 | qpqual,
|
803 | 802 | baserelid,
|
804 |
| - FastListValue(&indexids), |
| 803 | + indexids, |
805 | 804 | fixed_indxquals,
|
806 | 805 | stripped_indxquals,
|
807 | 806 | indxstrategy,
|
@@ -1427,28 +1426,27 @@ get_switched_clauses(List *clauses, Relids outerrelids)
|
1427 | 1426 | static List *
|
1428 | 1427 | order_qual_clauses(Query *root, List *clauses)
|
1429 | 1428 | {
|
1430 |
| - FastList nosubplans; |
1431 |
| - FastList withsubplans; |
| 1429 | + List *nosubplans; |
| 1430 | + List *withsubplans; |
1432 | 1431 | ListCell *l;
|
1433 | 1432 |
|
1434 | 1433 | /* No need to work hard if the query is subselect-free */
|
1435 | 1434 | if (!root->hasSubLinks)
|
1436 | 1435 | return clauses;
|
1437 | 1436 |
|
1438 |
| - FastListInit(&nosubplans); |
1439 |
| - FastListInit(&withsubplans); |
| 1437 | + nosubplans = NIL; |
| 1438 | + withsubplans = NIL; |
1440 | 1439 | foreach(l, clauses)
|
1441 | 1440 | {
|
1442 | 1441 | Node *clause = (Node *) lfirst(l);
|
1443 | 1442 |
|
1444 | 1443 | if (contain_subplans(clause))
|
1445 |
| - FastAppend(&withsubplans, clause); |
| 1444 | + withsubplans = lappend(withsubplans, clause); |
1446 | 1445 | else
|
1447 |
| - FastAppend(&nosubplans, clause); |
| 1446 | + nosubplans = lappend(nosubplans, clause); |
1448 | 1447 | }
|
1449 | 1448 |
|
1450 |
| - FastConcFast(&nosubplans, &withsubplans); |
1451 |
| - return FastListValue(&nosubplans); |
| 1449 | + return list_concat(nosubplans, withsubplans); |
1452 | 1450 | }
|
1453 | 1451 |
|
1454 | 1452 | /*
|
|
0 commit comments