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: Invent "join domains" to replace the below_outer_join hack.
Date: Mon, 30 Jan 2023 19:13:28 +0000
Message-ID: <E1pMZao-000l40-Q3@gemulon.postgresql.org> (raw)

Invent "join domains" to replace the below_outer_join hack.

EquivalenceClasses are now understood as applying within a "join
domain", which is a set of inner-joined relations (possibly underneath
an outer join).  We no longer need to treat an EC from below an outer
join as a second-class citizen.

I have hopes of eventually being able to treat outer-join clauses via
EquivalenceClasses, by means of only applying deductions within the
EC's join domain.  There are still problems in the way of that, though,
so for now the reconsider_outer_join_clause logic is still here.

I haven't been able to get rid of RestrictInfo.is_pushed_down either,
but I wonder if that could be recast using JoinDomains.

I had to hack one test case in postgres_fdw.sql to make it still test
what it was meant to, because postgres_fdw is inconsistent about
how it deals with quals containing non-shippable expressions; see
https://postgr.es/m/1691374.1671659838@sss.pgh.pa.us.  That should
be improved, but I don't think it's within the scope of this patch
series.

Patch by me; thanks to Richard Guo for review.

Discussion: https://postgr.es/m/830269.1656693747@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3bef56e11650a33f70adeb6dd442bc2b48bb9b72

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out |  14 +-
contrib/postgres_fdw/sql/postgres_fdw.sql      |   2 +-
src/backend/nodes/outfuncs.c                   |   1 -
src/backend/optimizer/path/equivclass.c        | 133 +++++++++------
src/backend/optimizer/path/joinpath.c          |  12 --
src/backend/optimizer/plan/createplan.c        |   5 +-
src/backend/optimizer/plan/initsplan.c         | 213 +++++++++++++------------
src/backend/optimizer/plan/planner.c           |  10 ++
src/backend/optimizer/prep/prepjointree.c      |   2 +
src/include/nodes/pathnodes.h                  |  67 ++++++--
src/include/optimizer/paths.h                  |   2 +-
src/include/optimizer/planmain.h               |   1 -
12 files changed, 269 insertions(+), 193 deletions(-)



Message-ID: <E1pMZao-000l40-Q3@gemulon.postgresql.org>
Permalink:  ../E1pMZao-000l40-Q3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pMZao-000l40-Q3@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 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: Invent "join domains" to replace the below_outer_join hack.
  In-Reply-To: <E1pMZao-000l40-Q3@gemulon.postgresql.org>
  References: <E1pMZao-000l40-Q3@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