Re: remove_useless_joins vs. bug #19560

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: remove_useless_joins vs. bug #19560
Date: 2026-10-04 06:14:30
Message-ID: CAMbWs48+9KEsnnNm9=BhFot_v8_9cPpPad1U9E1ynETxJ_kgzA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 25, 2026 at 8:43 PM Ayush Tiwari
<ayushtiwari(dot)slg01(at)gmail(dot)com> wrote:
> Would it make sense to skip PHVs during that argument walk too,
> while still processing other SubLinks in the argument? The attached
> patch tries that, with small tests for sum() and GROUPING().

Skipping PHVs in build_subplan looks right to me. Any PHV found
within the arguments of an outer-level Aggref is a pushed-down copy
that its owning level has already preprocessed, so there is nothing
left to do in it. The flag looks ugly though, but I don't have a
better fix than that.

I plan to push this fix soon if there are no objections.

- Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-10-04 06:23:20 Re: Report relation extension blockers within parallel lock groups
Previous Message Bertrand Drouvot 2026-10-04 05:59:59 Re: Persist slot invalidations before publishing them