Re: explain analyze rows=%.0f - Mailing list pgsql-hackers

From Robert Haas
Subject Re: explain analyze rows=%.0f
Date
Msg-id CA+TgmobMEbWEDsKQ5ezaBEnwcWLcTef5yupx2bOj03aKj1GvRA@mail.gmail.com
Whole thread Raw
In response to Re: explain analyze rows=%.0f  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: explain analyze rows=%.0f
List pgsql-hackers
On Mon, Mar 31, 2025 at 1:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > But why isn't it just as valuable to have two decimal places for the
> > estimate? I theorize that the cases that are really a problem here are
> > those where the row count estimate is between 0 and 1 per row, and
> > rounding to an integer loses all precision.
>
> Currently, the planner rounds *all* rowcount estimates to integers
> (cf. clamp_row_est()).  Maybe it'd be appropriate to rethink that,
> but it's not just a matter of changing EXPLAIN's print format.

Oh, right. I've never really understood why we round off to integers,
but the fact that we don't allow row counts < 1 feels like something
pretty important. My intuition is that it probably helps a lot more
than it hurts, too.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: Using read stream in autoprewarm
Next
From: Robert Haas
Date:
Subject: Re: RFC: Logging plan of the running query