Re: explain analyze rows=%.0f
От | Ilia Evdokimov |
---|---|
Тема | Re: explain analyze rows=%.0f |
Дата | |
Msg-id | 1a7b5bea-336b-40b5-a7c8-c7aefe8778b6@tantorlabs.com обсуждение исходный текст |
Ответ на | Re: explain analyze rows=%.0f (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: explain analyze rows=%.0f
|
Список | 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.
В списке pgsql-hackers по дате отправления: