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: Support "Right Anti Join" plan shapes.
Date: Wed, 05 Apr 2023 20:59:25 +0000
Message-ID: <E1pkAE0-001Y6Q-9z@gemulon.postgresql.org> (raw)

Support "Right Anti Join" plan shapes.

Merge and hash joins can support antijoin with the non-nullable input
on the right, using very simple combinations of their existing logic
for right join and anti join.  This gives the planner more freedom
about how to order the join.  It's particularly useful for hash join,
since we may now have the option to hash the smaller table instead
of the larger.

Richard Guo, reviewed by Ronan Dunklau and myself

Discussion: https://postgr.es/m/CAMbWs48xh9hMzXzSy3VaPzGAz+fkxXXTUbCLohX1_L8THFRm2Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/16dc2703c5413534d4989e08253e8f4fcb0e2aab

Modified Files
--------------
src/backend/commands/explain.c               |   3 +
src/backend/executor/nodeHashjoin.c          |  35 ++--
src/backend/executor/nodeMergejoin.c         |  33 ++--
src/backend/optimizer/path/costsize.c        |   3 +-
src/backend/optimizer/path/joinpath.c        |  49 +++--
src/backend/optimizer/path/joinrels.c        |   3 +
src/backend/optimizer/path/pathkeys.c        |  10 +-
src/backend/optimizer/prep/prepjointree.c    |  14 +-
src/include/nodes/execnodes.h                |   3 +-
src/include/nodes/nodes.h                    |   4 +-
src/include/nodes/pathnodes.h                |   5 +-
src/test/regress/expected/partition_join.out | 276 ++++++++++++++-------------
12 files changed, 244 insertions(+), 194 deletions(-)



Message-ID: <E1pkAE0-001Y6Q-9z@gemulon.postgresql.org>
Permalink:  ../E1pkAE0-001Y6Q-9z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pkAE0-001Y6Q-9z@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Support "Right Anti Join" plan shapes.
  In-Reply-To: <E1pkAE0-001Y6Q-9z@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