From: Vik Fearing <vik@postgresfriends.org>
To: 2320415112@qq.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19563: Planner does not eliminate redundant outer DISTINCT over UNION
Date: Tue, 21 Jul 2026 16:28:20 +0200
Message-ID: <74d59eb1-8100-4899-9f70-6e29f22e4c5b@postgresfriends.org> (raw)
In-Reply-To: <19563-444007e4ab7c1292@postgresql.org>
References: <19563-444007e4ab7c1292@postgresql.org>
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@qq.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: vik@postgresfriends.org, 2320415112@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19563: Planner does not eliminate redundant outer DISTINCT over UNION
In-Reply-To: <74d59eb1-8100-4899-9f70-6e29f22e4c5b@postgresfriends.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox