1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

Revise aggregate functions per earlier discussions in pghackers.

There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...
This commit is contained in:
Tom Lane
2000-07-17 03:05:41 +00:00
parent 139f19c302
commit bec98a31c5
55 changed files with 1949 additions and 1813 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: primnodes.h,v 1.43 2000/06/12 19:40:49 momjian Exp $
* $Id: primnodes.h,v 1.44 2000/07/17 03:05:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -301,10 +301,9 @@ typedef struct Iter
* basetype - base type Oid of the aggregate (ie, input type)
* aggtype - type Oid of final result of the aggregate
* target - attribute or expression we are aggregating on
* usenulls - TRUE to accept null values as inputs
* aggstar - TRUE if argument was really '*'
* aggdistinct - TRUE if arguments were labeled DISTINCT
* aggno - workspace for nodeAgg.c executor
* aggdistinct - TRUE if it's agg(DISTINCT ...)
* aggno - workspace for executor (see nodeAgg.c)
* ----------------
*/
typedef struct Aggref
@@ -314,7 +313,6 @@ typedef struct Aggref
Oid basetype;
Oid aggtype;
Node *target;
bool usenulls;
bool aggstar;
bool aggdistinct;
int aggno;