Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3 - Mailing list pgsql-general

From Greg Stark
Subject Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3
Date
Msg-id 87y94mobtc.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3
Next
From: Tom Lane
Date:
Subject: Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3