Re: explain analyze rows=%.0f

Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>

From: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: Daniel Gustafsson <daniel@yesql.se>, Ibrar Ahmed <ibrar.ahmad@gmail.com>, "Gregory Stark (as CFM)" <stark.cfm@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@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>, pgsql-hackers@lists.postgresql.org
Date: 2025-01-13T20:18:18Z
Lists: pgsql-hackers

Attachments

On 11.01.2025 14:10, Ilia Evdokimov wrote:
>
>
> On 11.01.2025 12:15, Guillaume Lelarge wrote:
>>
>>
>> Thanks for your patch, this looks like a very interesting feature 
>> that I'd like to see in a future release.
>>
>> It did a quick run: patch OK, make OK, make install OK, but make 
>> check fails quite a lot on partition_prune.sql.
>>
>> I guess it would need some work on partition_prune.sql tests and 
>> perhaps also on the docs.
>>
>> Thanks again.
>>
>>
>> -- 
>> Guillaume.
>
>
> Yes, certainly. I have fixed partition_prune.sql. In the documentation 
> example for EXPLAIN ANALYZE where loops is greater than one, I updated 
> how 'rows' and 'loops' values are displayed so they appear as decimal 
> fractions with two digits after the decimal point.
>
> I attached fixed patch.
>
> Any suggestions?
>
> --
> Best regards,
> Ilia Evdokimov,
> Tantor Labs LLC.
>

I guess, it's not ideal to modify the existing example in the 
documentation of the v5 patch because readers wouldn't immediately 
understand why decimal fractions appear there. Instead, I'll add a brief 
note in the documentation clarifying how rows and loops are displayed 
when the average row count is below one.

The changes the of documentation are attached v6 patch.

If you have any other suggestions or different opinions, I'd be happy to 
discuss them.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.

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.