SQL - Indexing for performance on uniquness check... - Mailing list pgsql-novice

From Loftis, Charles E
Subject SQL - Indexing for performance on uniquness check...
Date
Msg-id 25DC89BACF65D549BA045B806348C65E045DC783@ushem201.exse01.exch.eds.com
Whole thread Raw
Responses Re: SQL - Indexing for performance on uniquness check...  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
When trying to find duplicates on an table how I need to know how index the
table to optimize performance.
Should there be an index for each attribute (A1, A2, ..., An) in the GROUP
BY or should there be one multi-attribute index on all the grouping
attributes.

Assume the table has more attributes than those attributes being GROUPed on.
Also, assume all attributes are of type varchar.

Sample query to return non-uniqueness
   SELECT A1, A2, A3, ..., An
   FROM Table
   GROUP BY A1, A2, A3, ..., An
   HAVING Count(*)>1

pgsql-novice by date:

Previous
From: Steve Tucknott
Date:
Subject: FUNCTION error and UNICODE
Next
From: Josh Berkus
Date:
Subject: Re: SQL - Indexing for performance on uniquness check...