Greg Stark <gsstark@mit.edu> writes:
> There's only a small decrease in speed from 7.3 to CVS now, but I was hoping
> for a big speed increase from hash aggregates since most of the time is being
> sunk into that sort. But it definitely isn't using them. I guess TNSTAAFL.
It looks like it's avoiding the hash choice because it thinks there will
be many groups, 15122 to be exact:
> -> GroupAggregate (cost=2686.58..2951.21 rows=15122 width=24) (actual time=917.64..1033.40
rows=31loops=1)
You could probably persuade it that hashed aggregation will be okay by
increasing sort_mem sufficiently. But it would also be interesting to
see if the number-of-groups estimate can be improved ... 15122 is rather
badly off from the true value of 31 ...
regards, tom lane