DISTINCT peformance differences

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: DISTINCT peformance differences
Date: 2002-08-15 02:13:27
Message-ID: GNELIHDDFBOCMGBFGEFOCELFCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

If art_id is the primary key of the la table, is the latter faster?

SELECT DISTINCT la.* FROM <join> ...

or

SELECT DISTINCT ON (la.art_id) la.* FROM <join> ...

ie. Does this offer a performance improvement by only doing the distinct on
the primary key or not?

Thanks,

Chris

Browse pgsql-sql by date

  From Date Subject
Next Message Masaru Sugawara 2002-08-15 02:17:15 Re: Need Help for select
Previous Message Masaru Sugawara 2002-08-14 22:57:31 Re: Need Help for select