From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix EXPLAIN ANALYZE of hash join when the leader doesn't partici
Date: Tue, 05 Dec 2017 19:03:02 +0000
Message-ID: <E1eMIUg-0003Cg-RZ@gemulon.postgresql.org> (raw)
Fix EXPLAIN ANALYZE of hash join when the leader doesn't participate.
If a hash join appears in a parallel query, there may be no hash table
available for explain.c to inspect even though a hash table may have
been built in other processes. This could happen either because
parallel_leader_participation was set to off or because the leader
happened to hit the end of the outer relation immediately (even though
the complete relation is not empty) and decided not to build the hash
table.
Commit bf11e7ee introduced a way for workers to exchange
instrumentation via the DSM segment for Sort nodes even though they
are not parallel-aware. This commit does the same for Hash nodes, so
that explain.c has a way to find instrumentation data from an
arbitrary participant that actually built the hash table.
Author: Thomas Munro
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/CAEepm%3D3DUQC2-z252N55eOcZBer6DPdM%3DFzrxH9dZc5vYLsjaA%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5bcf389ecfd40daf92238e1abbff4fc4d3f18b33
Modified Files
--------------
src/backend/commands/explain.c | 60 +++++++++++++++------
src/backend/executor/execParallel.c | 43 +++++++++++----
src/backend/executor/execProcnode.c | 3 ++
src/backend/executor/nodeHash.c | 104 ++++++++++++++++++++++++++++++++++++
src/include/executor/nodeHash.h | 9 ++++
src/include/nodes/execnodes.h | 26 +++++++++
src/test/regress/expected/join.out | 15 ++++++
src/test/regress/sql/join.sql | 11 ++++
8 files changed, 245 insertions(+), 26 deletions(-)
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: andres@anarazel.de
Subject: Re: pgsql: Fix EXPLAIN ANALYZE of hash join when the leader doesn't partici
In-Reply-To: <E1eMIUg-0003Cg-RZ@gemulon.postgresql.org>
References: <E1eMIUg-0003Cg-RZ@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