pgsql: Work around implementation restriction in adjust_appendrel_attrs - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Work around implementation restriction in adjust_appendrel_attrs
Date
Msg-id E1pbQJM-003CjE-4H@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Add standard collation UNICODE
Next
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Add standard collation UNICODE