From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow partitionwise join to handle nested FULL JOIN USING cases.
Date: Wed, 08 Apr 2020 02:12:25 +0000
Message-ID: <E1jM0CX-0003Ip-7O@gemulon.postgresql.org> (raw)
Allow partitionwise join to handle nested FULL JOIN USING cases.
This case didn't work because columns merged by FULL JOIN USING are
represented in the parse tree by COALESCE expressions, and the logic
for recognizing a partitionable join failed to match upper-level join
clauses to such expressions. To fix, synthesize suitable COALESCE
expressions and add them to the nullable_partexprs lists. This is
pretty ugly and brute-force, but it gets the job done. (I have
ambitions of rethinking the way outer-join output Vars are
represented, so maybe that will provide a cleaner solution someday.
For now, do this.)
Amit Langote, reviewed by Justin Pryzby, Richard Guo, and myself
Discussion: https://postgr.es/m/CA+HiwqG2WVUGmLJqtR0tPFhniO=H=9qQ+Z3L_ZC+Y3-EVQHFGg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/981643dcdb70b6ce70d8a08417f71f465f236cb5
Modified Files
--------------
src/backend/optimizer/util/relnode.c | 45 ++++++++++-
src/include/nodes/pathnodes.h | 3 +
src/test/regress/expected/partition_join.out | 110 +++++++++++++++++++++++++++
src/test/regress/sql/partition_join.sql | 18 +++++
4 files changed, 174 insertions(+), 2 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: Allow partitionwise join to handle nested FULL JOIN USING cases.
In-Reply-To: <E1jM0CX-0003Ip-7O@gemulon.postgresql.org>
References: <E1jM0CX-0003Ip-7O@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