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

From: Achilleas Mantzios - cloud <a(dot)mantzios(at)cloud(dot)gatewaynet(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: number of updated or deleted tuples needed to trigger a VACUUM in any one table
Date: 2024-11-08 14:57:28
Message-ID: 3745e187-bf8f-48f8-8311-8da66eaff1cc@cloud.gatewaynet.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On 11/7/24 16:30, Ron Johnson wrote:
>
> https://www.postgresql.org/docs/current/runtime-config-autovacuum.html
>
> |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

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios - cloud 2024-11-08 15:04:07 Re: Hi Corruption in Postgres
Previous Message Ron Johnson 2024-11-08 14:08:36 Re: Running rsync backups in pg15