|
14 | 14 | * |
15 | 15 | * |
16 | 16 | * IDENTIFICATION |
17 | | - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.53 2000/03/21 05:11:58 tgl Exp $ |
| 17 | + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.54 2000/03/24 21:40:43 tgl Exp $ |
18 | 18 | * |
19 | 19 | *------------------------------------------------------------------------- |
20 | 20 | */ |
@@ -174,7 +174,6 @@ subplanner(Query *root, |
174 | 174 | { |
175 | 175 | RelOptInfo*final_rel; |
176 | 176 | Path*cheapestpath; |
177 | | -Pathsort_path;/* dummy for result of cost_sort */ |
178 | 177 | Path*presortedpath; |
179 | 178 |
|
180 | 179 | /* |
@@ -288,21 +287,22 @@ subplanner(Query *root, |
288 | 287 | * cheaper than doing an explicit sort on the cheapest-total-cost path. |
289 | 288 | */ |
290 | 289 | cheapestpath=final_rel->cheapest_total_path; |
291 | | -cost_sort(&sort_path,root->query_pathkeys, |
292 | | -final_rel->rows,final_rel->width); |
293 | | -sort_path.startup_cost+=cheapestpath->total_cost; |
294 | | -sort_path.total_cost+=cheapestpath->total_cost; |
295 | | - |
296 | 290 | presortedpath= |
297 | 291 | get_cheapest_fractional_path_for_pathkeys(final_rel->pathlist, |
298 | 292 | root->query_pathkeys, |
299 | 293 | tuple_fraction); |
300 | 294 | if (presortedpath) |
301 | 295 | { |
| 296 | +Pathsort_path;/* dummy for result of cost_sort */ |
| 297 | + |
| 298 | +cost_sort(&sort_path,root->query_pathkeys, |
| 299 | +final_rel->rows,final_rel->width); |
| 300 | +sort_path.startup_cost+=cheapestpath->total_cost; |
| 301 | +sort_path.total_cost+=cheapestpath->total_cost; |
302 | 302 | if (compare_fractional_path_costs(presortedpath,&sort_path, |
303 | 303 | tuple_fraction) <=0) |
304 | 304 | { |
305 | | -/*Found a better presorted path, use it */ |
| 305 | +/*Presorted path is cheaper, use it */ |
306 | 306 | root->query_pathkeys=presortedpath->pathkeys; |
307 | 307 | returncreate_plan(root,presortedpath); |
308 | 308 | } |
|