pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support parallel joins, and make related improvements.
Date: Wed, 20 Jan 2016 19:41:07 +0000
Message-ID: <E1aLyct-000314-UZ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Support parallel joins, and make related improvements.

The core innovation of this patch is the introduction of the concept
of a partial path; that is, a path which if executed in parallel will
generate a subset of the output rows in each process.  Gathering a
partial path produces an ordinary (complete) path.  This allows us to
generate paths for parallel joins by joining a partial path for one
side (which at the baserel level is currently always a Partial Seq
Scan) to an ordinary path on the other side.  This is subject to
various restrictions at present, especially that this strategy seems
unlikely to be sensible for merge joins, so only nested loops and
hash joins paths are generated.

This also allows an Append node to be pushed below a Gather node in
the case of a partitioned table.

Testing revealed that early versions of this patch made poor decisions
in some cases, which turned out to be caused by the fact that the
original cost model for Parallel Seq Scan wasn't very good.  So this
patch tries to make some modest improvements in that area.

There is much more to be done in the area of generating good parallel
plans in all cases, but this seems like a useful step forward.

Patch by me, reviewed by Dilip Kumar and Amit Kapila.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/45be99f8cd5d606086e0a458c9c72910ba8a613d

Modified Files
--------------
src/backend/executor/execParallel.c     |   66 +++---
src/backend/nodes/outfuncs.c            |    4 +-
src/backend/optimizer/README            |   55 ++++-
src/backend/optimizer/path/allpaths.c   |  164 ++++++++++----
src/backend/optimizer/path/costsize.c   |   61 ++++--
src/backend/optimizer/path/joinpath.c   |  253 +++++++++++++++++++++-
src/backend/optimizer/path/joinrels.c   |    3 +-
src/backend/optimizer/plan/createplan.c |    2 +-
src/backend/optimizer/plan/planmain.c   |    3 +-
src/backend/optimizer/util/pathnode.c   |  361 ++++++++++++++++++++++++++++---
src/backend/optimizer/util/relnode.c    |    2 +
src/include/nodes/relation.h            |    4 +-
src/include/optimizer/cost.h            |    2 +-
src/include/optimizer/pathnode.h        |   12 +-
src/include/optimizer/paths.h           |    2 +
15 files changed, 875 insertions(+), 119 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (4+ messages)  latest in thread

Message-ID: <E1aLyct-000314-UZ@gemulon.postgresql.org>
Permalink:  ../E1aLyct-000314-UZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aLyct-000314-UZ@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: rhaas@postgresql.org
  Subject: Re: pgsql: Support parallel joins, and make related improvements.
  In-Reply-To: <E1aLyct-000314-UZ@gemulon.postgresql.org>
  References: <E1aLyct-000314-UZ@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