From: | Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru> |
Subject: | Re: explain analyze rows=%.0f |
Date: | 2025-03-31 20:59:48 |
Message-ID: | 1a7b5bea-336b-40b5-a7c8-c7aefe8778b6@tantorlabs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 31.03.2025 22:09, Robert Haas wrote:
> 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.
We definitely shouldn’t remove the row counts < 1 check, since there are
many places in the planner where we divide by rows. This mechanism was
added specifically to prevent division by zero. Also, allowing rows
estimates below 1 can sometimes make the planner overly optimistic,
leading it to prefer cheaper-looking plans that may not perform well in
practice. For example, choosing a Nested Loop instead of a more
appropriate Hash Join.
Allowing fractional rows > 1 might help improve planner accuracy in some
cases, but this needs further study to fully understand the impact.
--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.
From | Date | Subject | |
---|---|---|---|
Next Message | Masahiko Sawada | 2025-03-31 21:05:12 | Re: Parallel heap vacuum |
Previous Message | David G. Johnston | 2025-03-31 20:42:16 | Re: Make COPY format extendable: Extract COPY TO format implementations |