pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Inzamam Shafiq <inzamam.shafiq@hotmail.com>
To: Thomas Boussekey <thomas.boussekey@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Autovacuum on sys tables
Date: Mon, 19 Dec 2022 06:12:29 +0000
Message-ID: <AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CALUeYmcZixsxCq7aU=Pb+AVkUGgR5y+WYf5h=EcivtinoWQymg@mail.gmail.com>
References: <AM9P251MB03301FB65BA063F541899F4098E79@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM>
	<CALUeYmcZixsxCq7aU=Pb+AVkUGgR5y+WYf5h=EcivtinoWQymg@mail.gmail.com>

Thanks Thomas for the response,

It means if I run VACUUM ANALYZE on pg_attribute or pg_class table, it is completely safe? Can you please also please confirm what is meant by "mid-level" vacuum?

Regards,

Inzamam Shafiq
Sr. DBA
________________________________
From: Thomas Boussekey <thomas.boussekey@gmail.com>
Sent: Sunday, December 18, 2022 4:01 PM
To: Inzamam Shafiq <inzamam.shafiq@hotmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Autovacuum on sys tables

Hello Inzamam,

Le sam. 17 déc. 2022 à 08:16, Inzamam Shafiq <inzamam.shafiq@hotmail.com<mailto:inzamam.shafiq@hotmail.com>> a écrit :
Dear Experts,

Hope you are doing well.

I have a question that autovacuum is running on sys tables like pg_class, pg_attribute, is it a normal thing? Further, what is dead tuples are not removed from Autovacuum, can we remove the dead tuples using FULL VACUUMM or pg_repack on sys tables?

pg_repack cannot run on system tables, it will FAIL with an explicit error message explaining the limitation.

Each time you perform DDL operations (CREATE, DROP, ALTER), rows are inserted/updated or deleted into the system tables : pg_class, pg_attribute ...
Autovacuum operations perform "low-level" operations, it can be interesting to perform "middle-level" vacuum with VACUUM ANALYZE... that is not blocking, but will be more a resource-consuming operation than autovacuum.

Performing VACUUM FULL operation will block access to these pillar tables of your database.
If your application/users can handle it, go ahead!
At work on this kind of operation, I set a statement_timeout, in order to properly stop the process if it is over a defined amount of time.

Hope this helps,
Thomas

Thank you.

Regards,

Inzamam Shafiq
Sr. DBA

view thread (6+ messages)  latest in thread

Message-ID: <AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM>
Permalink:  ../AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: inzamam.shafiq@hotmail.com, thomas.boussekey@gmail.com
  Subject: Re: Autovacuum on sys tables
  In-Reply-To: <AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM>
  References: <AM9P251MB03301FB65BA063F541899F4098E79@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM> <CALUeYmcZixsxCq7aU=Pb+AVkUGgR5y+WYf5h=EcivtinoWQymg@mail.gmail.com> <AM9P251MB0330F9629060DF4A146F337498E59@AM9P251MB0330.EURP251.PROD.OUTLOOK.COM>

* 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