2010/4/5 Kevin Grittner <[email protected]>: > Robert Haas <[email protected]> wrote: > >> You can do: >> >> SELECT COUNT(*) FROM (SELECT DISTINCT profile.id, profile.name, >> profile.age FROM ...) x; > > Ah, I see what they wanted now. In older versions of PostgreSQL, > they might get better performance in some cases by using GROUP BY: > > SELECT COUNT(*) FROM > (SELECT id, name, age FROM profile GROUP BY id, name, age) x; > > I don't remember offhand what version started considering a hash for > DISTINCT. > 8.4
http://www.postgresql.org/docs/8.4/static/release-8-4.html regards Pavel > -Kevin > > -- > Sent via pgsql-hackers mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers > -- Sent via pgsql-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
