pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Exclude new pages from VACUUM reltuples estimates
2+ messages / 1 participants
[nested] [flat]

* pgsql: Exclude new pages from VACUUM reltuples estimates
@ 2026-11-13 21:51 Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Melanie Plageman @ 2026-11-13 21:51 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Exclude new pages from VACUUM reltuples estimates

VACUUM always scans PageIsNew blocks because they have no visibility map
bits. They could already distort reltuples estimates when all-visible
pages were skipped by successive VACUUMs. However, on-access VM setting
(b46e1e54d) makes this more likely by making it possible that some
all-visible pages will never be scanned by vacuum.

Exclude PageIsNew blocks from the sampled pages and sampleable
population that is used to extrapolate reltuples for the unscanned
pages.

Reported-by: Vaibhav Jain <jainva@google.com>
Co-authored-by: Vaibhav Jain <jainva@google.com>
Co-authored-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/flat/CABa-Az2YXuX%2B_JH8VL89i7oA%2BDC74GvfkSsM9%2B92fGCeWYVCqg%40mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/206e71935e1ed86e6116b118d7b77e78efcff8b8

Modified Files
--------------
contrib/pgstattuple/pgstatapprox.c   | 16 ++++++-
src/backend/access/heap/vacuumlazy.c | 16 +++++--
src/backend/commands/vacuum.c        | 28 +++++++----
src/include/commands/vacuum.h        |  1 +
src/test/regress/expected/vacuum.out | 93 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 43 +++++++++++++++++
6 files changed, 183 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Exclude new pages from VACUUM reltuples estimates
@ 2026-11-13 21:54 Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Melanie Plageman @ 2026-11-13 21:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Exclude new pages from VACUUM reltuples estimates

VACUUM always scans PageIsNew blocks because they have no visibility map
bits. They could already distort reltuples estimates when all-visible
pages were skipped by successive VACUUMs. However, on-access VM setting
(b46e1e54d) makes this more likely by making it possible that some
all-visible pages will never be scanned by vacuum.

Exclude PageIsNew blocks from the sampled pages and sampleable
population that is used to extrapolate reltuples for the unscanned
pages.

Reported-by: Vaibhav Jain <jainva@google.com>
Co-authored-by: Vaibhav Jain <jainva@google.com>
Co-authored-by: Melanie Plageman <melanieplageman@gmail.com>
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/e2b2267d24e79f58ba25f1cd2e168059d2f23c26

Modified Files
--------------
contrib/pgstattuple/pgstatapprox.c   | 16 ++++++-
src/backend/access/heap/vacuumlazy.c | 16 +++++--
src/backend/commands/vacuum.c        | 28 +++++++----
src/include/commands/vacuum.h        |  1 +
src/test/regress/expected/vacuum.out | 93 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/vacuum.sql      | 43 +++++++++++++++++
6 files changed, 183 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-11-13 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 21:51 pgsql: Exclude new pages from VACUUM reltuples estimates Melanie Plageman <melanieplageman@gmail.com>
2026-11-13 21:54 pgsql: Exclude new pages from VACUUM reltuples estimates Melanie Plageman <melanieplageman@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox