1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Add an at-least-marginally-plausible method of estimating the number

of groups produced by GROUP BY.  This improves the accuracy of planning
estimates for grouped subselects, and is needed to check whether a
hashed aggregation plan risks memory overflow.
This commit is contained in:
Tom Lane
2002-11-19 23:22:00 +00:00
parent 54cb1db6cf
commit b60be3f2f8
11 changed files with 454 additions and 75 deletions

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: selfuncs.h,v 1.9 2002/10/19 02:56:16 tgl Exp $
* $Id: selfuncs.h,v 1.10 2002/11/19 23:22:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,6 +75,9 @@ extern void mergejoinscansel(Query *root, Node *clause,
Selectivity *leftscan,
Selectivity *rightscan);
extern double estimate_num_groups(Query *root, List *groupClauses,
double input_rows);
extern Datum btcostestimate(PG_FUNCTION_ARGS);
extern Datum rtcostestimate(PG_FUNCTION_ARGS);
extern Datum hashcostestimate(PG_FUNCTION_ARGS);