Re: Vacuum statistics
Alena Rybakina <lena.ribackina@yandex.ru>
From: Alena Rybakina <lena.ribackina@yandex.ru>
To: pgsql-hackers <pgsql-hackers@postgresql.org>,
Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Jim Nasby <jnasby@upgrade.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>,
Kirill Reshke <reshkekirill@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>,
Melanie Plageman <melanieplageman@gmail.com>,
jian he <jian.universality@gmail.com>, Sami Imseih <samimseih@gmail.com>,
vignesh C <vignesh21@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>,
Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>,
Andrey Borodin <x4mmm@yandex-team.ru>, Andrei Zubkov <zubkov@moonset.ru>,
Andrei Lepikhov <lepihov@gmail.com>
Date: 2026-06-16T15:09:53Z
Lists: pgsql-hackers
Attachments
- 0001-Track-table-VM-stability.patch (text/plain) patch 0001
- 0002-Extended-vacuum-statistics-core-heap-and-tuple-metri.patch (text/plain) patch 0002
- 0003-Extended-vacuum-statistics-missed-dead-tuples-and-pa.patch (text/plain) patch 0003
- 0004-Extended-vacuum-statistics-visibility-map-page-trans.patch (text/plain) patch 0004
- 0005-Extended-vacuum-statistics-buffer-WAL-timing-machine.patch (text/plain) patch 0005
- 0006-Extended-vacuum-statistics-per-relation-buffer-acces.patch (text/plain) patch 0006
- 0007-Extended-vacuum-statistics-timing-metrics-and-failsa.patch (text/plain) patch 0007
- 0008-Extended-vacuum-statistics-WAL-metrics-for-tables-in.patch (text/plain) patch 0008
Hi, all!
Attached is a reworked version of the patch set. The main change is that the
statistics are no longer exposed through a contrib extension; they are now
built-in system views - pg_stat_vacuum_tables, pg_stat_vacuum_indexes and
pg_stat_vacuum_database - backed by pg_stat_get_vacuum_*() functions and
stored
in the cumulative statistics system under a dedicated stats kind
(PGSTAT_KIND_VACUUM_RELATION). Collection is controlled by a single
track_vacuum_statistics GUC; the per-relation tracking list, the reset
function and the shared-memory-size helper from the extension version
are gone.
The series is also split into smaller, self-contained commits - one per
metric
category (core heap/tuple counters, missed dead tuples/pages, visibility-map
transitions, the buffer/WAL/timing sampling machinery, per-relation buffers,
timing and the wraparound failsafe, and WAL) - with the documentation and
tests growing inside each commit.
Other changes:
* index statistics are accumulated across the bulkdelete and cleanup
passes and reported once per index, in both the serial and parallel
paths;
* index_vacuum_count is no longer exposed;
* the regression coverage is now an in-core vacuum_stats test with
deterministic checks and dedicated scenarios for the non-trivial
paths (truncation, freeze, cost delay, WAL full-page images, index
page deletion), an isolation test for recently_dead/missed_dead
tuples, and a xid_wraparound TAP test for the failsafe counter.
--
-----------
Best regards,
Alena Rybakina
Yandex Cloud
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add relallfrozen to pg_class
- 99f8f3fbbc8f 18.0 cited
-
Move wal_buffers_full from PgStat_PendingWalStats to WalUsage
- eaf502747bac 18.0 cited