From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add a Gather Merge executor node.
Date: Thu, 09 Mar 2017 12:49:42 +0000
Message-ID: <E1clxVm-0001Zk-Ce@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Add a Gather Merge executor node.
Like Gather, we spawn multiple workers and run the same plan in each
one; however, Gather Merge is used when each worker produces the same
output ordering and we want to preserve that output ordering while
merging together the streams of tuples from various workers. (In a
way, Gather Merge is like a hybrid of Gather and MergeAppend.)
This works out to a win if it saves us from having to perform an
expensive Sort. In cases where only a small amount of data would need
to be sorted, it may actually be faster to use a regular Gather node
and then sort the results afterward, because Gather Merge sometimes
needs to wait synchronously for tuples whereas a pure Gather generally
doesn't. But if this avoids an expensive sort then it's a win.
Rushabh Lathia, reviewed and tested by Amit Kapila, Thomas Munro,
and Neha Sharma, and reviewed and revised by me.
Discussion: http://postgr.es/m/CAGPqQf09oPX-cQRpBKS0Gq49Z+m6KBxgxd_p9gX8CKk_d75HoQ@mail.gmail.com
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/355d3993c53ed62c5b53d020648e4fbcfbf5f155
Modified Files
--------------
doc/src/sgml/config.sgml | 14 +
src/backend/commands/explain.c | 23 +
src/backend/executor/Makefile | 2 +-
src/backend/executor/execProcnode.c | 17 +
src/backend/executor/nodeGatherMerge.c | 687 ++++++++++++++++++++++++++
src/backend/nodes/copyfuncs.c | 28 ++
src/backend/nodes/outfuncs.c | 46 ++
src/backend/nodes/readfuncs.c | 22 +
src/backend/optimizer/path/allpaths.c | 36 +-
src/backend/optimizer/path/costsize.c | 68 +++
src/backend/optimizer/plan/createplan.c | 86 ++++
src/backend/optimizer/plan/planner.c | 127 ++++-
src/backend/optimizer/plan/setrefs.c | 1 +
src/backend/optimizer/plan/subselect.c | 1 +
src/backend/optimizer/util/pathnode.c | 60 +++
src/backend/utils/misc/guc.c | 9 +
src/include/executor/nodeGatherMerge.h | 27 +
src/include/nodes/execnodes.h | 29 ++
src/include/nodes/nodes.h | 3 +
src/include/nodes/plannodes.h | 16 +
src/include/nodes/relation.h | 13 +
src/include/optimizer/cost.h | 5 +
src/include/optimizer/pathnode.h | 7 +
src/test/regress/expected/select_parallel.out | 27 +
src/test/regress/expected/sysviews.out | 3 +-
src/test/regress/sql/select_parallel.sql | 11 +
src/tools/pgindent/typedefs.list | 3 +
27 files changed, 1355 insertions(+), 16 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Add a Gather Merge executor node.
In-Reply-To: <E1clxVm-0001Zk-Ce@gemulon.postgresql.org>
References: <E1clxVm-0001Zk-Ce@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