Re: Aggregate functions, fast! (long)

From: Ang Chin Han <angch(at)pintoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Aggregate functions, fast! (long)
Date: 2000-08-09 07:33:37
Message-ID: 20000809153337.A6032@pintoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Aug 09, 2000 at 02:53:45PM +0800, Ang Chin Han wrote:

> The queries making use of these might be rewritten as:
> 1. select min(a) from t_sum; -- same as above,
> -- but we've less rows to scan
> 2. select cnt from t_sum where a = 1 and b = 3;

Sorry, bugfix:
select sum(cnt) from t_sum where a = 1 and b = 3;
since c is not referenced.

> 3. select sum(d * cnt) as sum from t_sum where a = 1 and c > 3;
> 4. select sum(b * cnt) / cnt as avg from t_sum where c = 1;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message luc00 2000-08-09 13:31:59 any tool "return query results to a grid "
Previous Message Ang Chin Han 2000-08-09 06:53:45 Aggregate functions, fast! (long)