pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix some inconsistencies in EXPLAIN output
Date: Thu, 16 May 2024 00:50:37 +0000
Message-ID: <E1s7PKP-000PoR-8H@gemulon.postgresql.org> (raw)

Fix some inconsistencies in EXPLAIN output

06286709e added a SERIALIZE option to EXPLAIN which included showing the
amount of kilobytes serialized.  The calculation to convert bytes into
kilobytes wasn't consistent with how that's done in the rest of EXPLAIN.
Traditionally we round up to the nearest kB, but the new code rounded to
the nearest kB.

To fix this, invent a macro that does the conversion and use that macro
everywhere that requires this conversion.

Additionally, 5de890e36 added EXPLAIN (MEMORY) but included the memory
sizes in bytes.  Convert these values to kilobytes to align with the
other memory related outputs.

In passing, swap out a "long" type in show_hash_info() and use a uint64
instead.  We do support platforms where sizeof(Size) == 8 and
sizeof(long) == 4, so using a long there is questionable.

Reported-by: jian he
Reviewed-by: jian he
Discussion: https://www.postgresql.org/message-id/CACJufxE4Sp7xvgOwhqtFx5hS85AxMKobPWDo-xZHZVTpK3EBjA@mail.gmail...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0de37b51065bc5b5848d65a9bb6f932ef392374f

Modified Files
--------------
src/backend/commands/explain.c        | 48 ++++++++++++++++++++---------------
src/test/regress/expected/explain.out |  6 ++---
2 files changed, 30 insertions(+), 24 deletions(-)



Message-ID: <E1s7PKP-000PoR-8H@gemulon.postgresql.org>
Permalink:  ../E1s7PKP-000PoR-8H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s7PKP-000PoR-8H@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix some inconsistencies in EXPLAIN output
  In-Reply-To: <E1s7PKP-000PoR-8H@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