Re: Should heapam_estimate_rel_size consider fillfactor?

Tomas Vondra <tomas@vondra.me>

From: Tomas Vondra <tomas@vondra.me>
To: Heikki Linnakangas <hlinnaka@iki.fi>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Peter Eisentraut <peter@eisentraut.org>, Corey Huinker <corey.huinker@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-02-04T16:54:06Z
Lists: pgsql-hackers

Attachments

On 2/4/25 16:02, Tomas Vondra wrote:
> ...
>
> Thanks for the report. And yeah, clamping it to 1 seems like the right
> fix for this. I wonder if it's worth inventing some sort of test for
> this, shouldn't be too hard I guess.
> 
> In any case, I'll take care of the fix/backpatch soon.
> 

Here's a proposed fix, including a simple test in the stats suite.


regards

-- 
Tomas Vondra

Commits

  1. Correct relation size estimate with low fillfactor

  2. Consider fillfactor when estimating relation size