From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque
Date: Fri, 29 Nov 2024 22:25:02 -0500
Message-ID: <824291.1732937102@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs48E8xR4T3G2ynFGGzh3nQ1zNwuxq_Fn92-gWGDr7As_cw@mail.gmail.com>
References: <E1tGn4j-0003zi-MP@gemulon.postgresql.org>
<CAMbWs4-4vf7XvYHjQBqsA67zaLdmyKPaznFw78Kcp9mxdqMKEw@mail.gmail.com>
<397371.1732844670@sss.pgh.pa.us>
<CAMbWs4-iZiWWb_KYJJEZ0=zQSD0WNwz_hvNTT3uABCVQNKP7Mg@mail.gmail.com>
<530989.1732907849@sss.pgh.pa.us>
<590235.1732915884@sss.pgh.pa.us>
<CAMbWs48E8xR4T3G2ynFGGzh3nQ1zNwuxq_Fn92-gWGDr7As_cw@mail.gmail.com>
Richard Guo <guofenglinux@gmail.com> writes:
> This patch can also simplify my other patch, which is to avoid
> unnecessary wrapping for plain Vars/PHVs. We can check the new
> nullingrel_info to see if the nullingrels of the subquery RTE are a
> subset of the nullingrels of the lateral referenced rel, to determine
> if the referenced rel is under the same lowest nulling outer join.
> And this eliminates the need to introduce lowest_nullable_side.
Right, because that's more or less the same problem. Or indeed
it's exactly the same problem, we're just making fast paths for
the easiest cases.
Another thought: the reason I made get_nullingrels return a new
struct rather than tying it directly to filling some fields in
pullup_replace_vars_context was that I think we might want to
reconsider where to call it from. Perhaps it'd be useful to
have the info during is_simple_subquery, for example.
regards, tom lane
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, guofenglinux@gmail.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque
In-Reply-To: <824291.1732937102@sss.pgh.pa.us>
* 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