pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make EXPLAIN report maximum hashtable usage across multiple resc
Date: Sat, 11 Apr 2020 16:39:33 +0000
Message-ID: <E1jNJAL-0000Cb-Ip@gemulon.postgresql.org> (raw)

Make EXPLAIN report maximum hashtable usage across multiple rescans.

Before discarding the old hash table in ExecReScanHashJoin, capture
its statistics, ensuring that we report the maximum hashtable size
across repeated rescans of the hash input relation.  We can repurpose
the existing code for reporting hashtable size in parallel workers
to help with this, making the patch pretty small.  This also ensures
that if rescans happen within parallel workers, we get the correct
maximums across all instances.

Konstantin Knizhnik and Tom Lane, per diagnosis by Thomas Munro
of a trouble report from Alvaro Herrera.

Discussion: https://postgr.es/m/20200323165059.GA24950@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/969f9d0b4ba574bb8df65683dbf7a09c030f3e67

Modified Files
--------------
src/backend/commands/explain.c      | 46 +++++++++++------------------
src/backend/executor/nodeHash.c     | 58 ++++++++++++++++++++++++++++---------
src/backend/executor/nodeHashjoin.c | 10 ++++++-
src/include/executor/nodeHash.h     |  4 +--
src/include/nodes/execnodes.h       | 18 ++++++++++--
5 files changed, 87 insertions(+), 49 deletions(-)



Message-ID: <E1jNJAL-0000Cb-Ip@gemulon.postgresql.org>
Permalink:  ../E1jNJAL-0000Cb-Ip@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jNJAL-0000Cb-Ip@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Make EXPLAIN report maximum hashtable usage across multiple resc
  In-Reply-To: <E1jNJAL-0000Cb-Ip@gemulon.postgresql.org>
  References: <E1jNJAL-0000Cb-Ip@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