mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Fix planning bug introduced in recent code reorganization for hashed
aggregates: tuple_fraction has to be adjusted before passing it to compare_fractional_path_costs().
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.127 2002/11/06 22:31:24 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.128 2002/11/14 19:00:36 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1257,6 +1257,9 @@ grouping_planner(Query *parse, double tuple_fraction)
|
|||||||
sorted_path->parent->rows, sorted_path->parent->width);
|
sorted_path->parent->rows, sorted_path->parent->width);
|
||||||
sort_path.startup_cost += cheapest_path->total_cost;
|
sort_path.startup_cost += cheapest_path->total_cost;
|
||||||
sort_path.total_cost += cheapest_path->total_cost;
|
sort_path.total_cost += cheapest_path->total_cost;
|
||||||
|
/* Convert absolute-count tuple_fraction into a fraction */
|
||||||
|
if (tuple_fraction >= 1.0)
|
||||||
|
tuple_fraction /= sorted_path->parent->rows;
|
||||||
if (compare_fractional_path_costs(sorted_path, &sort_path,
|
if (compare_fractional_path_costs(sorted_path, &sort_path,
|
||||||
tuple_fraction) <= 0)
|
tuple_fraction) <= 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user