Re: Removing useless DISTINCT clauses - Mailing list pgsql-hackers

From David Rowley
Subject Re: Removing useless DISTINCT clauses
Date
Msg-id CAKJS1f83wb3WYHsnqFnv-BXXKDSAJ2SDVXTEWDXRffV2LaoeyA@mail.gmail.com
Whole thread Raw
In response to Re: Removing useless DISTINCT clauses  ("Finnerty, Jim" <jfinnert@amazon.com>)
Responses Re: Removing useless DISTINCT clauses
List pgsql-hackers
On 24 August 2018 at 03:29, Finnerty, Jim <jfinnert@amazon.com> wrote:
> Thank you Álvaro.  Here's the distinct_opt_v7 patch.

Determining if there's just 1 base relation by checking the length the
rtable is not a good way. If you want to see why, try creating a
primary key on a partitioned table.

My personal opinion of only being able to completely remove the
DISTINCT when there's a single item in the rtable (or a single base
table) is that it's just too poor to bother with.  I think such a
solution is best left to another patch and it should be much more
complete and be able to track the unique properties through joins.

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Make executor's Range Table an array instead of a List
Next
From: Stephen Frost
Date:
Subject: Re: Removing useless DISTINCT clauses