Re: n_ins_since_vacuum stats for aborted transactions

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: n_ins_since_vacuum stats for aborted transactions
Date: 2025-04-09 18:31:55
Message-ID: CAA5RZ0u1pN4Xi3PeZFDAt8OpPzkJ4FkS1GnN3KSHzWTHGsa5Kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

I don't see in the commit message why inserts in an aborted transaction
must count towards n_ins_since_vacuum.

> 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.

Correct,but they are dead tuples that are physically in the files, and
are accounted for through
n_dead_tup and are then cleaned up based on the
autovacuum_vacuum_scale_factor|threshold
calculation.

The purpose of b07642dbcd8d is to trigger autovacuum for append only/mainly
workloads that don't generate dead tuples.

--
Sami Imseih
Amazon Web Services (AWS)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-04-09 18:41:39 Re: Adding support for SSLKEYLOGFILE in the frontend
Previous Message Euler Taveira 2025-04-09 18:07:19 Re: n_ins_since_vacuum stats for aborted transactions