pgsql: Scale VACUUM reltuples estimates after relation growth

Поиск
Список
Период
Сортировка
Искать

pgsql: Scale VACUUM reltuples estimates after relation growth

От:
Melanie Plageman <melanieplageman@gmail.com>
Дата:
Scale VACUUM reltuples estimates after relation growth

VACUUM kept the old reltuples value when it scanned at most one page,
even if the relation size changed. This left stale estimates after table
growth or shrinkage. Commit b46e1e54d made scanning one page more likely
by allowing newly populated pages to become all-visible before VACUUM.

Preserve reltuples only when relation size is unchanged; otherwise, scale
the old tuple density to the current size.

Only backpatch as far as 19, even though it was present before, to avoid
changing stats logic in stable branches.

Reported-by: Vaibhav Jain 
Author: Vaibhav Jain 
Reviewed-by: Melanie Plageman 
Discussion: https://postgr.es/m/flat/CABa-Az2YXuX%2B_JH8VL89i7oA%2BDC74GvfkSsM9%2B92fGCeWYVCqg%40mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/baa86d46a186d56d2377e2946ac7ce6e8ed1e0be

Modified Files
--------------
src/backend/commands/vacuum.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

FAQ