Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
Cc: andres(at)taylor(dot)se, pgsql-hackers(at)lists(dot)postgresql(dot)org, David Rowley <dgrowleyml(at)gmail(dot)com>, zhihuifan1213(at)163(dot)com, guofenglinux(at)gmail(dot)com
Subject: Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness
Date: 2026-07-23 15:23:33
Message-ID: 39973.1784820213@localhost
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com> wrote:

> Thanks a lot for detailed review.
>
> Since there's already patch work on the UniqueKeys approach, I think it make
> sense to keep building on that rather than staring over. Thanks for rebase
> onto master. I attached 0001-patch with it.
>
> CC: Antonin, Andy

Not sure if you noticed that, related work was posted yesterday:

https://www.postgresql.org/message-id/CAMbWs4-iLcqBr_n_F5gNrzQbBMrKgkpGwqTu7boWeoYepf%3D%2B8g%40mail.gmail.com

I've already spent some time looking at it and I think it's more advanced than
the previous attempts to implement the "unique keys".

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Melanie Plageman 2026-07-23 15:07:56 Re: BUG: ReadStream look-ahead exhausts local buffers when effective_io_concurrency>=64