Re: explain analyze rows=%.0f
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Alena Rybakina <a.rybakina@postgrespro.ru>, Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andrei Lepikhov <lepihov@gmail.com>, pgsql-hackers@lists.postgresql.org, Guillaume Lelarge <guillaume@lelarge.info>,
Matheus Alcantara <matheusssilv97@gmail.com>
Date: 2025-03-06T14:13:45Z
Lists: pgsql-hackers
On Thu, Mar 6, 2025 at 8:30 AM Matthias van de Meent <boekewurm+postgres@gmail.com> wrote: > On Thu, 6 Mar 2025 at 14:18, Alena Rybakina <a.rybakina@postgrespro.ru> wrote: > > > > Hi! I got a query plan with a strange number of rows. Could you please > > help me understand it? > > > > To be honest I can't understand why 0.50 number of rows here? > > Because the scan matched only ~(500 rows over 999 iterations = 500/999 > ~=) 0.50 rows for every loop, on average, for these plan nodes: This is a good and correct explanation, but I'm VERY curious to hear more from Alena. Like, Tom expressed the concern before we did this that the fractional digits would confuse people, and the fact that someone who is a regular participant on this mailing list was one of the people confused gives credence to that concern. But I want to know what exactly Alena found (or finds) confusing here. The Nested Loop executes 999 times, so perhaps Alena thought that 0.50 was the TOTAL number of rows across ALL of those executions rather than the AVERAGE number of rows per execution? Because then 0.50 would indeed be a very surprising result. Or maybe she just didn't realize that part of the plan executed 999 times? Or something else? Alena, if you're willing, please elaborate on what you think is confusing here! -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
EXPLAIN: Always use two fractional digits for row counts.
- 95dbd827f2ed 18.0 landed
-
Adjust EXPLAIN test case to filter out "Actual Rows" values.
- 44cbba9a7f51 18.0 cited
-
Allow EXPLAIN to indicate fractional rows.
- ddb17e387aa2 18.0 landed
-
Fix pgbench performance issue induced by commit af35fe501.
- fb056564ec5b 18.0 cited