Subject: number of updated or deleted tuples needed to trigger a VACUUM in any one table

From: Ron Johnson <[email-masked]>
Date: Thu, 7 Nov 2024 10:30:40 -0500

https://www.postgresql.org/docs/current/runtime-config-autovacuum.html

autovacuum_vacuum_threshold (integer)
<https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-THRESHOLD>

Specifies the minimum number of updated or deleted tuples needed to trigger
a VACUUM in any one table.

Are the number of updated and deleted tuples since the last vacuum exposed
anywhere, like n_ins_since_vacuum is exposed?

I've Googled with no luck.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Achilleas Mantzios - cloud <[email-masked]>
Date: Fri, 8 Nov 2024 15:57:28 +0100

On 11/7/24 16:30, Ron Johnson wrote:
> |autovacuum_vacuum_threshold| (|integer|)
>
>     Specifies the minimum number of updated or deleted tuples needed
>     to trigger a |VACUUM| in any one table.
>
>
> Are the number of updated and deleted tuples since the last vacuum 
> exposed anywhere, like n_ins_since_vacuum is exposed?

By /usr/local/src/postgresql-17.0/src/backend/postmaster/autovacuum.c:3026 :

reltuples = classForm->reltuples;
                vactuples = tabentry->dead_tuples;
                instuples = tabentry->ins_since_vacuum;
                anltuples = tabentry->mod_since_analyze;

So, this number should be the pg_stat_all_tables.n_dead_tup