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 Append plan nodes.
Date: Tue, 05 Dec 2017 22:31:22 +0000
Message-ID: <E1eMLkI-0007I0-Aw@gemulon.postgresql.org> (raw)

Support Parallel Append plan nodes.

When we create an Append node, we can spread out the workers over the
subplans instead of piling on to each subplan one at a time, which
should typically be a bit more efficient, both because the startup
cost of any plan executed entirely by one worker is paid only once and
also because of reduced contention.  We can also construct Append
plans using a mix of partial and non-partial subplans, which may allow
for parallelism in places that otherwise couldn't support it.
Unfortunately, this patch doesn't handle the important case of
parallelizing UNION ALL by running each branch in a separate worker;
the executor infrastructure is added here, but more planner work is
needed.

Amit Khandekar, Robert Haas, Amul Sul, reviewed and tested by
Ashutosh Bapat, Amit Langote, Rafia Sabih, Amit Kapila, and
Rajkumar Raghuwanshi.

Discussion: http://postgr.es/m/CAJ3gD9dy0K_E8r727heqXoBmWZ83HwLFwdcaSSmBQ1+S+vRuUQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ab72716778128fb63d54ac256adf7fe6820a1185

Modified Files
--------------
doc/src/sgml/config.sgml                      |  14 ++
doc/src/sgml/monitoring.sgml                  |   7 +-
src/backend/executor/execParallel.c           |  19 ++
src/backend/executor/nodeAppend.c             | 331 +++++++++++++++++++++-----
src/backend/nodes/copyfuncs.c                 |   1 +
src/backend/nodes/list.c                      |  38 +++
src/backend/nodes/outfuncs.c                  |   1 +
src/backend/nodes/readfuncs.c                 |   1 +
src/backend/optimizer/path/allpaths.c         | 216 ++++++++++++++---
src/backend/optimizer/path/costsize.c         | 164 +++++++++++++
src/backend/optimizer/path/joinrels.c         |   3 +-
src/backend/optimizer/plan/createplan.c       |  10 +-
src/backend/optimizer/plan/planner.c          |   5 +-
src/backend/optimizer/prep/prepunion.c        |   7 +-
src/backend/optimizer/util/pathnode.c         |  88 +++++--
src/backend/storage/lmgr/lwlock.c             |   1 +
src/backend/utils/misc/guc.c                  |   9 +
src/backend/utils/misc/postgresql.conf.sample |   1 +
src/include/executor/nodeAppend.h             |   5 +
src/include/nodes/execnodes.h                 |  14 +-
src/include/nodes/pg_list.h                   |   3 +
src/include/nodes/plannodes.h                 |   1 +
src/include/nodes/relation.h                  |   6 +
src/include/optimizer/cost.h                  |   2 +
src/include/optimizer/pathnode.h              |   9 +-
src/include/storage/lwlock.h                  |   1 +
src/test/regress/expected/inherit.out         |   2 +
src/test/regress/expected/select_parallel.out |  91 ++++++-
src/test/regress/expected/sysviews.out        |   3 +-
src/test/regress/sql/inherit.sql              |   2 +
src/test/regress/sql/select_parallel.sql      |  33 ++-
31 files changed, 959 insertions(+), 129 deletions(-)



view thread (13+ messages)  latest in thread

Message-ID: <E1eMLkI-0007I0-Aw@gemulon.postgresql.org>
Permalink:  ../E1eMLkI-0007I0-Aw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eMLkI-0007I0-Aw@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 Append plan nodes.
  In-Reply-To: <E1eMLkI-0007I0-Aw@gemulon.postgresql.org>
  References: <E1eMLkI-0007I0-Aw@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