Re: n_ins_since_vacuum stats for aborted transactions

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: n_ins_since_vacuum stats for aborted transactions
Date: 2025-04-09 19:58:32
Message-ID: CAHgHdKsjGkrdpjZxmfOYxuvhBDrBK48T9bMKmb-6Pj38NiLYXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The issue I see is that n_ins_since_vacuum should only
> reflect the number of newly inserted rows that are eligible for
> freezing, as described
> in pgstat_report_vacuum [0]
>
> [0]
> https://github.com/postgres/postgres/blob/master/src/backend/utils/activity/pgstat_relation.c#L238-L247

For the archives, that paragraph reads:

/*
* It is quite possible that a non-aggressive VACUUM ended up skipping
* various pages, however, we'll zero the insert counter here regardless.
* It's currently used only to track when we need to perform an "insert"
* autovacuum, which are mainly intended to freeze newly inserted tuples.
* Zeroing this may just mean we'll not try to vacuum the table again
* until enough tuples have been inserted to trigger another insert
* autovacuum. An anti-wraparound autovacuum will catch any persistent
* stragglers.
*/

What work do you believe the word "mainly" does in that paragraph? The
presence of the word "mainly" rather than "only" somewhat cuts against your
argument that we should only be counting tuples that get inserted without
aborting.


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-04-09 20:13:34 Re: n_ins_since_vacuum stats for aborted transactions
Previous Message Sami Imseih 2025-04-09 19:56:25 Re: n_ins_since_vacuum stats for aborted transactions