Melanie Plageman wrote:
> Contents & Purpose
> ==================
>
> This patch removes any additional columns in the DISTINCT clause when the
> table's primary key columns are entirely present in the DISTINCT clause. This
> optimization works because the PK columns functionally determine the other
> columns in the relation. The patch includes regression test cases.
Would it be very difficult to extend that to "if any unique constraints are
contained in the DISTINCT clause"?
Yours,
Laurenz Albe