Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness

From: Andrés Taylor <andres(at)taylor(dot)se>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
Subject: Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness
Date: 2026-06-22 08:49:01
Message-ID: 178211814104.991.7333413279255303867.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: tested, passed
Spec compliant: tested, failed
Documentation: not tested

Reviewed v1. The optimization looks worthwhile, but the current patch needs a correctness fix for target-list SRFs, as discussed on-list, plus a regression test. This seems like a contained revision. There is also a broader design question about whether this should eventually be handled through planner-level uniqueness infrastructure, as raised earlier on the thread. Marking Waiting on Author for now.

The new status of this patch is: Waiting on Author

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-06-22 08:55:45 Re: truncating casts of pgoff_t
Previous Message Yingying Chen 2026-06-22 08:46:45 Re: Fix handling of copy_file_range() return value