pgsql: Allow EXPLAIN to indicate fractional rows.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow EXPLAIN to indicate fractional rows.
Date: 2025-02-21 21:20:06
Message-ID: E1tlaRK-0001o3-1J@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow EXPLAIN to indicate fractional rows.

When nloops > 1, we now display two digits after the decimal point,
rather than none. This is important because what we print is actually
planstate->instrument->ntuples / nloops, and sometimes what you want
to know is planstate->instrument->ntuples. You can estimate that by
multiplying the displayed row count by the displayed nloops value, but
the fact that the displayed value is rounded makes that inexact. It's
still inexact even if we show these two extra decimal places, but less
so. Perhaps we will agree on a way to further improve this output later,
but for now this seems better than doing nothing.

Author: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
Author: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
Reviewed-by: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Reviewed-by: Vignesh C <vignesh21(at)gmail(dot)com>
Reviewed-by: Greg Stark <stark(at)mit(dot)edu>
Reviewed-by: Naeem Akhter <akhternaeem(at)gmail(dot)com>
Reviewed-by: Hamid Akhtar <hamid(dot)akhtar(at)percona(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
Reviewed-by: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Reviewed-by: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Reviewed-by: Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>
Discussion: http://postgr.es/m/603c8f070905281830g2e5419c4xad2946d149e21f9d%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ddb17e387aa28d61521227377b00f997756b8a27

Modified Files
--------------
src/backend/commands/explain.c | 50 +++++++++++-----
src/test/regress/expected/explain.out | 4 +-
src/test/regress/expected/memoize.out | 86 +++++++++++++--------------
src/test/regress/expected/partition_prune.out | 42 ++++++-------
src/test/regress/expected/select_parallel.out | 24 ++++----
src/test/regress/sql/partition_prune.sql | 2 +-
6 files changed, 113 insertions(+), 95 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-02-21 22:07:09 pgsql: Avoid race condition between "GRANT role" and "DROP ROLE".
Previous Message Masahiko Sawada 2025-02-21 20:31:42 pgsql: Add test 005_char_signedness.pl to meson.build.