From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Work around implementation restriction in adjust_appendrel_attrs
Date: Sun, 12 Mar 2023 18:20:48 +0000
Message-ID: <E1pbQJM-003CjE-4H@gemulon.postgresql.org> (raw)
Work around implementation restriction in adjust_appendrel_attrs.
adjust_appendrel_attrs can't transfer nullingrel labeling to a non-Var
translation expression (mainly because it's too late to wrap such an
expression in a PlaceHolderVar). I'd supposed in commit 2489d76c4
that that restriction was unreachable because we'd not attempt to push
problematic clauses down to an appendrel child relation. I forgot that
set_append_rel_size blindly converts all the parent rel's joininfo
clauses to child clauses, and that list could well contain clauses
from above a nulling outer join.
We might eventually have to devise a direct fix for this implementation
restriction, but for now it seems enough to filter out troublesome
clauses while constructing the child's joininfo list. Such clauses
are certainly not useful while constructing paths for the child rel;
they'll have to be applied later when we join the completed appendrel
to something else. So we don't need them here, and omitting them from
the list should save a few cycles while processing the child rel.
Per bug #17832 from Marko Tiikkaja.
Discussion: https://postgr.es/m/17832-d0a8106cdf1b722e@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/767c598954bbf72e0535f667e2e0667765604b2a
Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 28 ++++++++++++++++++++++++----
src/test/regress/expected/join.out | 22 ++++++++++++++++++++++
src/test/regress/sql/join.sql | 7 +++++++
3 files changed, 53 insertions(+), 4 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Work around implementation restriction in adjust_appendrel_attrs
In-Reply-To: <E1pbQJM-003CjE-4H@gemulon.postgresql.org>
References: <E1pbQJM-003CjE-4H@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