Skip to content

Commit 89caf56

Browse files
committed
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().
1 parent 65fbc29 commit 89caf56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.127 2002/11/06 22:31:24 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.128 2002/11/14 19:00:36 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1257,6 +1257,9 @@ grouping_planner(Query *parse, double tuple_fraction)
12571257
sorted_path->parent->rows, sorted_path->parent->width);
12581258
sort_path.startup_cost += cheapest_path->total_cost;
12591259
sort_path.total_cost += cheapest_path->total_cost;
1260+
/* Convert absolute-count tuple_fraction into a fraction */
1261+
if (tuple_fraction >= 1.0)
1262+
tuple_fraction /= sorted_path->parent->rows;
12601263
if (compare_fractional_path_costs(sorted_path, &sort_path,
12611264
tuple_fraction) <= 0)
12621265
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy