Re: BUG #19567: Redundant outer DISTINCT causes a second full aggregation above UNION

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: 2320415112(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19567: Redundant outer DISTINCT causes a second full aggregation above UNION
Date: 2026-07-22 11:34:01
Message-ID: 1364084.1784720041@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thom Brown <thom(at)linux(dot)com> writes:
> This doesn't look like a bug, but rather an enhancement request.

Yeah, not one of these are bugs. Some of them might be missed
optimization opportunities. But you'd need to show that the extra
planning cost of detecting such cases is worthwhile, ie there's
a reasonably large fraction of real-world queries that would
benefit materially.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Thom Brown 2026-07-22 11:19:29 Re: BUG #19566: redundant HAVING COUNT(*) > 0 changes a parallel hash join into a substantially faster indexed