Re: Configure autovacuum

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Configure autovacuum
Date: 2024-06-14 09:17:36
Message-ID: CANzqJaDcDunMABGpD9jF+F2-Ce_qch7Z0_KwJjarZ-_1Jo4pkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 14, 2024 at 2:20 AM Shenavai, Manuel <manuel(dot)shenavai(at)sap(dot)com>
wrote:

> Hi everyone,
>
>
>
> I would like to configure the autovacuum in a way that it runs very
> frequently (i.e. after each update-statement). I tried the following
> settings on my table:
>
> alter table mytable set (autovacuum_vacuum_scale_factor = 0.0);
>
> alter table mytable set (autovacuum_vacuum_cost_delay = 0.0);
>
> alter table mytable set (autovacuum_vacuum_cost_limit = 10000);
>
> alter table mytable set (autovacuum_vacuum_threshold = 1);
>
>
>
> I do a lot of updates on a single tuple and I would expect that the
> autovacuum would start basically after each update (due to
> autovacuum_vacuum_threshold=1). But the autovacuum is not running.
>

HOT is probably what you're looking for:
https://www.postgresql.org/docs/14/storage-hot.html

Presuming that the field you're updating is not indexed, and the table can
be exclusively locked for as long as it takes to rewrite it: give the table
"more space to work" in each page:
ALTER TABLE foo SET (fillfactor = 30);
VACUUM FULL foo;

Then you don't need to VACUUM soooo frequently.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-06-14 14:32:04 Re: Configure autovacuum
Previous Message Laurenz Albe 2024-06-14 07:44:57 Re: Reserving GUC prefixes from a non-preloaded DB extension is not always enforced