Re: autovacuum default run with vacuum_index_cleanup and vacuum_truncate and related lock?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: autovacuum default run with vacuum_index_cleanup and vacuum_truncate and related lock?
Date: 2022-02-07 16:09:20
Message-ID: 9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 2022-02-07 at 08:43 +0000, James Pang (chaolpan) wrote:
> It’s Postgres 13 version, we plan to migrate from Oracle to Postgres 13 on RHEL8.
> One maintain job is about autovacuum, with default config,  autovacuum will do on
> tables with  “vacuum_index_cleanup” and “vacuum_truncate” option?
> With both options, autovacuum woker will hold “access exclusive” lock when truncate
> empty blocks and cleanup index ?  if that’s true, how to handle autovacuum to reduce
> the lock blocking issue?

Cleaning up the index will not take any locks that block data modifications.

The ACCESS EXCLUSIVE lock for truncation is only held for a very short time
and won't bother you (unless perhaps, you could get replication conflicts on
a standby server).

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Axel Rau 2022-02-07 17:00:01 Re: restarting logical replication after upgrading standby
Previous Message Dan Smith 2022-02-07 13:14:30 Re: [Help][Service not coming-up]