pgsql: Allow partitionwise join to handle nested FULL JOIN USING cases.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow partitionwise join to handle nested FULL JOIN USING cases.
Date: 2020-04-08 02:12:25
Message-ID: E1jM0CX-0003Ip-7O@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-04-08 02:18:01 Re: pgsql: Implement waiting for given lsn at transaction start
Previous Message Andres Freund 2020-04-08 02:10:07 Re: pgsql: Allow users to limit storage reserved by replication slots