|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.17 1997/12/1803:03:35 momjian Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.18 1997/12/1812:20:30 momjian Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
|
46 | 46 | staticList*switch_outer(List*clauses);
|
47 | 47 | staticScan*create_scan_node(Path*best_path,List*tlist);
|
48 | 48 | staticJoin*create_join_node(JoinPath*best_path,List*tlist);
|
49 |
| -staticSeqScan* |
50 |
| -create_seqscan_node(Path*best_path,List*tlist, |
| 49 | +staticSeqScan*create_seqscan_node(Path*best_path,List*tlist, |
51 | 50 | List*scan_clauses);
|
52 |
| -staticIndexScan* |
53 |
| -create_indexscan_node(IndexPath*best_path,List*tlist, |
| 51 | +staticIndexScan*create_indexscan_node(IndexPath*best_path,List*tlist, |
54 | 52 | List*scan_clauses);
|
55 |
| -staticNestLoop* |
56 |
| -create_nestloop_node(JoinPath*best_path,List*tlist, |
| 53 | +staticNestLoop*create_nestloop_node(JoinPath*best_path,List*tlist, |
57 | 54 | List*clauses,Plan*outer_node,List*outer_tlist,
|
58 | 55 | Plan*inner_node,List*inner_tlist);
|
59 |
| -staticMergeJoin* |
60 |
| -create_mergejoin_node(MergePath*best_path,List*tlist, |
| 56 | +staticMergeJoin*create_mergejoin_node(MergePath*best_path,List*tlist, |
61 | 57 | List*clauses,Plan*outer_node,List*outer_tlist,
|
62 | 58 | Plan*inner_node,List*inner_tlist);
|
63 |
| -staticHashJoin* |
64 |
| -create_hashjoin_node(HashPath*best_path,List*tlist, |
| 59 | +staticHashJoin*create_hashjoin_node(HashPath*best_path,List*tlist, |
65 | 60 | List*clauses,Plan*outer_node,List*outer_tlist,
|
66 | 61 | Plan*inner_node,List*inner_tlist);
|
67 | 62 | staticNode*fix_indxqual_references(Node*clause,Path*index_path);
|
68 |
| -staticTemp* |
69 |
| -make_temp(List*tlist,List*keys,Oid*operators, |
| 63 | +staticTemp*make_temp(List*tlist,List*keys,Oid*operators, |
70 | 64 | Plan*plan_node,inttemptype);
|
71 |
| -staticIndexScan* |
72 |
| -make_indexscan(List*qptlist,List*qpqual,Indexscanrelid, |
73 |
| -List*indxid,List*indxqual); |
74 |
| -staticNestLoop* |
75 |
| -make_nestloop(List*qptlist,List*qpqual,Plan*lefttree, |
| 65 | +staticIndexScan*make_indexscan(List*qptlist,List*qpqual,Indexscanrelid, |
| 66 | +List*indxid,List*indxqual,Costcost); |
| 67 | +staticNestLoop*make_nestloop(List*qptlist,List*qpqual,Plan*lefttree, |
76 | 68 | Plan*righttree);
|
77 |
| -staticHashJoin* |
78 |
| -make_hashjoin(List*tlist,List*qpqual, |
| 69 | +staticHashJoin*make_hashjoin(List*tlist,List*qpqual, |
79 | 70 | List*hashclauses,Plan*lefttree,Plan*righttree);
|
80 | 71 | staticHash*make_hash(List*tlist,Var*hashkey,Plan*lefttree);
|
81 |
| -staticMergeJoin* |
82 |
| -make_mergesort(List*tlist,List*qpqual, |
| 72 | +staticMergeJoin*make_mergesort(List*tlist,List*qpqual, |
83 | 73 | List*mergeclauses,Oidopcode,Oid*rightorder,
|
84 | 74 | Oid*leftorder,Plan*righttree,Plan*lefttree);
|
85 |
| -staticMaterial* |
86 |
| -make_material(List*tlist,Oidtempid,Plan*lefttree, |
| 75 | +staticMaterial*make_material(List*tlist,Oidtempid,Plan*lefttree, |
87 | 76 | intkeycount);
|
88 | 77 |
|
89 | 78 | /*
|
@@ -415,9 +404,8 @@ create_indexscan_node(IndexPath *best_path,
|
415 | 404 | qpqual,
|
416 | 405 | lfirsti(best_path->path.parent->relids),
|
417 | 406 | best_path->indexid,
|
418 |
| -fixed_indxqual); |
419 |
| - |
420 |
| -scan_node->scan.plan.cost=best_path->path.path_cost; |
| 407 | +fixed_indxqual, |
| 408 | +best_path->path.path_cost); |
421 | 409 |
|
422 | 410 | return (scan_node);
|
423 | 411 | }
|
@@ -960,12 +948,13 @@ make_indexscan(List *qptlist,
|
960 | 948 | List*qpqual,
|
961 | 949 | Indexscanrelid,
|
962 | 950 | List*indxid,
|
963 |
| -List*indxqual) |
| 951 | +List*indxqual, |
| 952 | +Costcost) |
964 | 953 | {
|
965 | 954 | IndexScan*node=makeNode(IndexScan);
|
966 | 955 | Plan*plan=&node->scan.plan;
|
967 | 956 |
|
968 |
| -plan->cost=0.0; |
| 957 | +plan->cost=cost; |
969 | 958 | plan->state= (EState*)NULL;
|
970 | 959 | plan->targetlist=qptlist;
|
971 | 960 | plan->qual=qpqual;
|
@@ -1117,11 +1106,11 @@ make_material(List *tlist,
|
1117 | 1106 | }
|
1118 | 1107 |
|
1119 | 1108 | Agg*
|
1120 |
| -make_agg(List*tlist,intnagg,Aggreg**aggs) |
| 1109 | +make_agg(List*tlist,intnagg,Aggreg**aggs,Plan*lefttree) |
1121 | 1110 | {
|
1122 | 1111 | Agg*node=makeNode(Agg);
|
1123 | 1112 |
|
1124 |
| -node->plan.cost=0.0; |
| 1113 | +node->plan.cost=(lefttree ?lefttree->cost :0); |
1125 | 1114 | node->plan.state= (EState*)NULL;
|
1126 | 1115 | node->plan.qual=NULL;
|
1127 | 1116 | node->plan.targetlist=tlist;
|
|