Re: COUNT DISTINCT?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: COUNT DISTINCT?
Date: 2002-07-30 21:45:16
Message-ID: 20020730144457.J9060-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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 ...

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-07-30 22:52:34 Re: COUNT DISTINCT?
Previous Message Josh Berkus 2002-07-30 21:27:18 COUNT DISTINCT?