Re: explain analyze rows=%.0f

Andrei Lepikhov <lepihov@gmail.com>

From: Andrei Lepikhov <lepihov@gmail.com>
To: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>, Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>, Matheus Alcantara <matheusssilv97@gmail.com>, Guillaume Lelarge <guillaume@lelarge.info>, Daniel Gustafsson <daniel@yesql.se>, Ibrar Ahmed <ibrar.ahmad@gmail.com>, "Gregory Stark (as CFM)" <stark.cfm@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, Peter Geoghegan <pg@bowt.ie>, vignesh C <vignesh21@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, Alena Rybakina <a.rybakina@postgrespro.ru>
Date: 2025-02-19T15:37:40Z
Lists: pgsql-hackers
On 19/2/2025 15:01, Ilia Evdokimov wrote:
> If we want to convey this information more clearly, we should consider a 
> more explicit approach. For example, instead of using a fractional 
> value, we could display the minimum and maximum row counts observed 
> during execution (e.g.,rows=10..20, formatting details could be 
> discussed). However, in my opinion, this discussion is beyond the scope 
> of this thread.
I think this approach is redundant. Usually, a problem is an unknown 
number of tuples because, having millions of loops, we produce a small 
number of tuples, but each tuple costs a lot because of a subplan or 
something like that. By printing fractional digits (of course, we need 
to view significant ones, but we already agreed on a couple of digits 
for now), we may resolve this corner-case problem fully - at least all 
examples in my experience would be resolved, and I have even maintained 
a patch for years to manage this.
Moreover, it is too simple to implement. I just can't imagine why not to 
do it right now.

-- 
regards, Andrei Lepikhov



Commits

  1. EXPLAIN: Always use two fractional digits for row counts.

  2. Adjust EXPLAIN test case to filter out "Actual Rows" values.

  3. Allow EXPLAIN to indicate fractional rows.

  4. Fix pgbench performance issue induced by commit af35fe501.