pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ang Chin Han <angch@pintoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Aggregate functions, fast! (long)
Date: Wed, 9 Aug 2000 15:33:37 +0800
Message-ID: <20000809153337.A6032@pintoo.com> (raw)
In-Reply-To: <20000809145345.B5894@pintoo.com>
References: <20000809145345.B5894@pintoo.com>

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;



view thread (2+ messages)

Message-ID: <20000809153337.A6032@pintoo.com>
Permalink:  ../20000809153337.A6032@pintoo.com/
Also on:    postgresql.org/message-id/20000809153337.A6032@pintoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: angch@pintoo.com
  Subject: Re: Aggregate functions, fast! (long)
  In-Reply-To: <20000809153337.A6032@pintoo.com>
  References: <20000809145345.B5894@pintoo.com> <20000809153337.A6032@pintoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox