On 21/07/2026 12:46, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 19563
> Logged by: cl hl
> Email address: 2320415112(at)qq(dot)com
> PostgreSQL version: 17.10
> Operating system: Linux LAPTOP-2SQAVLB0 6.6.87.2-microsoft-standard-
> Description:
>
> PostgreSQL keeps an extra duplicate-removal operator for a redundant outer
> `DISTINCT` over a `UNION` query.
Funny this should come up, I have recently been working on improvements
for DISTINCT tracking. Nothing ready to publish yet, but at least one
other person noticed this missed optimization, and others like it.
--
Vik Fearing