Re: Redundant Unique plan node for table with a unique index - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Redundant Unique plan node for table with a unique index
Date
Msg-id 84395D19-2160-4EF7-8D49-708468085F7B@yesql.se
Whole thread Raw
In response to Redundant Unique plan node for table with a unique index  (Damir Belyalov <dam.bel07@gmail.com>)
List pgsql-hackers
> On 13 Sep 2023, at 15:22, Damir Belyalov <dam.bel07@gmail.com> wrote:

> There is a table with a unique index on it and we have a query that searching DISTINCT values on this table on
columnsof unique index. 

> We can see that Unique node is redundant for this case. So I implemented a simple patch that removes Unique node from
theplan. 

Is this query pattern common enough to warrant spending time on in the planner
(are there perhaps ORMs that generate such)?  Have you measured the overhead of
this?

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Damir Belyalov
Date:
Subject: Redundant Unique plan node for table with a unique index
Next
From: Peter Eisentraut
Date:
Subject: Re: [ psql - review request ] review request for \d+ tablename, \d+ indexname indenting