Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3
Date: 2003-02-11 19:29:51
Message-ID: 87y94mobtc.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> The count(distinct) you've got in there turns it off.

AAAH. That makes sense. Unfortunately I think I'm stuck with that, I'll have
to check though.

It was always a bit mysterious to me how postgres could implement
count(distinct) without introducing a separate sort and aggregate for each
occurrence.

I suppose it could rewrite it into an inner grouping with the added column,
then an outer grouping without it with a normal count(). But then that would
only work with a single count(distinct). And I'm not clear it would win for
this example either since there could actually be a pretty large number of
distinct values on that column. hmm...

Thanks for all the help.

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-11 19:36:38 Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3
Previous Message Tom Lane 2003-02-11 19:17:17 Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3