pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCOUNT DISTINCT?
3+ messages / 2 participants
[nested] [flat]
* COUNT DISTINCT?
@ 2002-07-30 21:27 Josh Berkus <josh@agliodbs.com>
2002-07-30 21:45 ` Re: COUNT DISTINCT? Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 1 reply; 3+ messages in thread
From: Josh Berkus @ 2002-07-30 21:27 UTC (permalink / raw)
To: pgsql-sql
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.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COUNT DISTINCT?
2002-07-30 21:27 COUNT DISTINCT? Josh Berkus <josh@agliodbs.com>
@ 2002-07-30 21:45 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-07-30 22:52 ` Re: COUNT DISTINCT? Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 3+ messages in thread
From: Stephan Szabo @ 2002-07-30 21:45 UTC (permalink / raw)
To: Josh Berkus <josh@agliodbs.com>; +Cc: 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 ...
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COUNT DISTINCT?
2002-07-30 21:27 COUNT DISTINCT? Josh Berkus <josh@agliodbs.com>
2002-07-30 21:45 ` Re: COUNT DISTINCT? Stephan Szabo <sszabo@megazone23.bigpanda.com>
@ 2002-07-30 22:52 ` Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 3+ messages in thread
From: Josh Berkus @ 2002-07-30 22:52 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-sql
Stephan,
> Would that be the same as:
> select count(distinct skip_date) from weekend_list
> where ...
Yeah, that would be what I was looking for.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-07-30 22:52 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-30 21:27 COUNT DISTINCT? Josh Berkus <josh@agliodbs.com>
2002-07-30 21:45 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-07-30 22:52 ` Josh Berkus <josh@agliodbs.com>
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