Track skipped tables during autovacuum and autoanalyze - Mailing list pgsql-hackers

From Yugo Nagata
Subject Track skipped tables during autovacuum and autoanalyze
Date
Msg-id 20260324151133.7940a5c1f2ebd594d54da481@sraoss.co.jp
Whole thread Raw
Responses Re: Track skipped tables during autovacuum and autoanalyze
List pgsql-hackers
Hi,

I would like to propose adding new fields to pg_stat_all_tables to track
tables skipped during autovacuum and autoanalyze.

Currently, when autovacuum or autoanalyze is skipped because a lock cannot
be acquired, this information is only emitted in log messages. However, it
would be more useful if users could access this information via a system view,
alongside related fields such as last_autovacuum, on a per-table basis.

The attached patch add the following fields to pg_stat_all_tables:
 - last_skipped_autovacuum
 - last_skipped_autoanalyze
 - skipped_autovacuum_count
 - skipped_autoanalyze_count

Are there any concerns about exposing this in pg_stat_all_tables, or suggestions
for a better approach?

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachment

pgsql-hackers by date:

Previous
From: Lukas Fittl
Date:
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Next
From: Zsolt Parragi
Date:
Subject: Re: [Patch] New pg_stat_tablespace view