pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: James Pang (chaolpan) <chaolpan@cisco.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: autovacuum default run with  vacuum_index_cleanup and vacuum_truncate and related lock?
Date: Mon, 07 Feb 2022 17:09:20 +0100
Message-ID: <9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at> (raw)
In-Reply-To: <PH0PR11MB51917B6D0E1C97DA6EAAEC3FD62C9@PH0PR11MB5191.namprd11.prod.outlook.com>
References: <PH0PR11MB51917B6D0E1C97DA6EAAEC3FD62C9@PH0PR11MB5191.namprd11.prod.outlook.com>

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






view thread (2+ messages)

Message-ID: <9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at>
Permalink:  ../9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at/
Also on:    postgresql.org/message-id/9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, chaolpan@cisco.com, pgsql-admin@lists.postgresql.org
  Subject: Re: autovacuum default run with  vacuum_index_cleanup and vacuum_truncate and related lock?
  In-Reply-To: <9a196c5db21caadb873493439011e4959d387ffe.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox