Re: n_ins_since_vacuum stats for aborted transactions

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Euler Taveira <euler@eulerto.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-04-09T21:48:24Z
Lists: pgsql-hackers
On Wednesday, April 9, 2025, Sami Imseih <samimseih@gmail.com> wrote:

>
> In other words, the reason n_ins_since_vacuum was introduced is to freeze
> (committed) rows, so it should not need to track dead rows to do what it
> intends
> to do.
>

n_ins_since_vacuum was introduced to indicate how many tuples a vacuum
would touch on an insert-only table should vacuum be run now.  Autovacuum
uses this value when determining whether a given relation should be
vacuumed.

David J.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add code comment explaining ins_since_vacuum and aborted inserts

  2. Trigger autovacuum based on number of INSERTs