Re: n_ins_since_vacuum stats for aborted transactions - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: n_ins_since_vacuum stats for aborted transactions
Date
Msg-id 7ad6715c-61c2-4b5c-b9b4-354d40cd1841@app.fastmail.com
Whole thread Raw
In response to n_ins_since_vacuum stats for aborted transactions  (Sami Imseih <samimseih@gmail.com>)
Responses Re: n_ins_since_vacuum stats for aborted transactions
List 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

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Sami Imseih
Date:
Subject: Re: n_ins_since_vacuum stats for aborted transactions