public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Korotkov <[email protected]>
To: Alena Rybakina <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Jim Nasby <[email protected]>
Cc: Bertrand Drouvot <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: Melanie Plageman <[email protected]>
Cc: jian he <[email protected]>
Cc: Sami Imseih <[email protected]>
Cc: vignesh C <[email protected]>
Cc: Ilia Evdokimov <[email protected]>
Cc: Andrey Borodin <[email protected]>
Cc: Andrei Zubkov <[email protected]>
Cc: Andrei Lepikhov <[email protected]>
Subject: Re: Vacuum statistics
Date: Tue, 16 Jun 2026 20:30:26 +0300
Message-ID: <CAPpHfdvsNSu3vxBQK4srQk5bp1PDKkMLfbv7HhzE3D_yW9ELvg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

Hi, Alena!

On Tue, Jun 16, 2026 at 6:10 PM Alena Rybakina <[email protected]> wrote:
> 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.

Thank you for the updated patchset.

Some notes about it.
1) PgStat_CommonCounts.interrupts_count is never incremented.
2) LVRelState.wraparound_failsafe_count can only be incremented once
in lazy_check_wraparound_failsafe().  Should we replace it with a
bool?
3) Vacuum statistics isn't counted correctly for parallel index
vacuum.  parallel_vacuum_process_one_index() doesn't call neither
extvac_stats_start_idx(), extvac_stats_end_idx(), or
extvac_accumulate_idx_repor().  This leads all index vacuum stats to
go the heap stats.  I also think you need a reliable test cases to
cover issues like this.
4) It seems that pgstat_vacuum_db_flush_cb() and
pgstat_vacuum_relation_flush_cb() are unused as
pgstat_report_vacuum_extstats() reports directly to shmem.  What was
your intention here?
5) Commit message of 0001 uses stale names
rev_all_visible_pages/rev_all_frozen_pages counters for
visible_page_marks_cleared` / `frozen_page_marks_cleared.

------
Regards,
Alexander Korotkov
Supabase






view thread (77+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Vacuum statistics
  In-Reply-To: <CAPpHfdvsNSu3vxBQK4srQk5bp1PDKkMLfbv7HhzE3D_yW9ELvg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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