DISTINCT peformance differences - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject DISTINCT peformance differences
Date
Msg-id GNELIHDDFBOCMGBFGEFOCELFCDAA.chriskl@familyhealth.com.au
Whole thread Raw
List 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



pgsql-sql by date:

Previous
From: Masaru Sugawara
Date:
Subject: Re: Need Help for select
Next
From: Masaru Sugawara
Date:
Subject: Re: Need Help for select