From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Support Parallel Append plan nodes. |
Date: | 2017-12-05 22:31:22 |
Message-ID: | E1eMLkI-0007I0-Aw@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-12-05 23:53:36 | pgsql: Fix broken markup. |
Previous Message | Peter Eisentraut | 2017-12-05 20:42:45 | pgsql: doc: Update memory requirements for FOP |
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2017-12-05 22:31:31 | Re: [HACKERS] Parallel Append implementation |
Previous Message | Thomas Munro | 2017-12-05 21:23:53 | Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com |