pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: COUNT DISTINCT?
Date: Tue, 30 Jul 2002 14:45:16 -0700 (PDT)
Message-ID: <20020730144457.J9060-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <200207301427.18815.josh@agliodbs.com>


On Tue, 30 Jul 2002, Josh Berkus wrote:

> Folks,
>
> Anybody know a keen shortcut for the following:
>
> SELECT count(skip_date)
> FROM (SELECT DISTINCT skip_date FROM weekend_list
> 		WHERE ... ...) days_to_skip;
>
> That's a double aggregate, and is bound to be dog-slow.

Would that be the same as:
select count(distinct skip_date) from weekend_list
 where ...




view thread (3+ messages)  latest in thread

Message-ID: <20020730144457.J9060-100000@megazone23.bigpanda.com>
Permalink:  ../20020730144457.J9060-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020730144457.J9060-100000@megazone23.bigpanda.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, josh@agliodbs.com
  Subject: Re: COUNT DISTINCT?
  In-Reply-To: <20020730144457.J9060-100000@megazone23.bigpanda.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