Re: BUG #19553: Wrong results from nested LEFT JOINs over an empty subquery (regression since v16)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, leis(at)in(dot)tum(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19553: Wrong results from nested LEFT JOINs over an empty subquery (regression since v16)
Date: 2026-07-20 02:35:28
Message-ID: 1065899.1784514928@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> It occurred to me that we can skip the new get_relids_in_jointree()
> scan altogether when there are no PHVs anywhere in the query
> (root->glob->lastPHId==0), since then the find_dependent_phvs() checks
> are no-ops anyway. This is also consistent with how we check
> root->glob->lastPHId in find_dependent_phvs() and
> find_dependent_phvs_in_jointree(). Attached is a trivial patch doing
> that.

WFM.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alena Vinter 2026-07-20 02:46:01 Re: pg_rewind WAL segments deletion pitfall
Previous Message Richard Guo 2026-07-20 02:33:23 Re: BUG #19553: Wrong results from nested LEFT JOINs over an empty subquery (regression since v16)