On Wed, Jul 6, 2011 at 1:04 PM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
> Dne 6.7.2011 15:30, bakkiya napsal(a):
>> Any help, please?
>
> According to the EXPLAIN ANALYZE output (please, don't post it to the
> mailing list directly - use something like explain.depesz.com, I've done
> that for you this time: http://explain.depesz.com/s/HMN) you're doing a
> UNIQUE over a lot of data (2 million rows, 1.5GB).
It might have been optimized lately, but generally unique is slower
than group by will be.