Re: n_ins_since_vacuum stats for aborted transactions

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Sami Imseih" <samimseih(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: n_ins_since_vacuum stats for aborted transactions
Date: 2025-04-09 18:07:19
Message-ID: 7ad6715c-61c2-4b5c-b9b4-354d40cd1841@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 9, 2025, at 1:57 PM, Sami Imseih wrote:
> I came across what appears to be incorrect behavior in the
> pg_stat_all_tables.n_ins_since_vacuum
> counter after a rollback.

This is *not* an oversight. It is by design. See commit b07642dbcd8d. The
documentation says

Estimated number of rows inserted since this table was last vacuumed

Those rows were actually inserted. They are physically in the data files. And
that's what matters for the autovacuum algorithm.

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-04-09 18:31:55 Re: n_ins_since_vacuum stats for aborted transactions
Previous Message Christoph Berg 2025-04-09 17:44:40 Re: [PoC] Federated Authn/z with OAUTHBEARER