pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Centralize fixups for mismatched nullingrels in nestloop params.
Date: Tue, 20 Jun 2023 14:30:05 +0000
Message-ID: <E1qBcMu-002jsg-JM@gemulon.postgresql.org> (raw)

Centralize fixups for mismatched nullingrels in nestloop params.

It turns out that the fixes we applied in commits bfd332b3f
and 63e4f13d2 were not nearly enough to solve the problem.
We'd focused narrowly on subquery RTEs with lateral references,
but lateral references can occur in several other RTE kinds
such as function RTEs.  Putting the same hack into half a dozen
code paths seems quite unattractive.  Hence, revert the code changes
(but not the test cases) from those commits and instead solve it
centrally in identify_current_nestloop_params(), as Richard proposed
originally.  This is a bit annoying because it could mask erroneous
nullingrels in nestloop params that are generated from non-LATERAL
parameterized paths; but on balance I don't see a better way.
Maybe at some future time we'll be motivated to find a more rigorous
approach to nestloop params, but that's not happening for beta2.

Richard Guo and Tom Lane

Discussion: https://postgr.es/m/CAMbWs48Jcw-NvnxT23WiHP324wG44DvzcH1j4hc0Zn+3sR9cfg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0655c03ef9cc6154b0b209059e758863dcf4e6b0

Modified Files
--------------
src/backend/optimizer/path/joinpath.c    | 37 -----------------
src/backend/optimizer/plan/setrefs.c     | 10 ++---
src/backend/optimizer/util/paramassign.c | 70 ++++++++++++++++++--------------
src/test/regress/expected/join.out       | 17 ++++++++
src/test/regress/sql/join.sql            |  7 ++++
5 files changed, 69 insertions(+), 72 deletions(-)



Message-ID: <E1qBcMu-002jsg-JM@gemulon.postgresql.org>
Permalink:  ../E1qBcMu-002jsg-JM@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qBcMu-002jsg-JM@gemulon.postgresql.org

 · 

reply

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, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Centralize fixups for mismatched nullingrels in nestloop params.
  In-Reply-To: <E1qBcMu-002jsg-JM@gemulon.postgresql.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