Re: vacuuming taking long time for pg_attribute - Mailing list pgsql-admin

From Jeff Janes
Subject Re: vacuuming taking long time for pg_attribute
Date
Msg-id CAMkU=1zFRdNrHfugMUkhqNPJtoAN=TJm1opKz=3ugbJrxM9PmA@mail.gmail.com
Whole thread Raw
In response to vacuuming taking long time for pg_attribute  (Siraj G <tosiraj.g@gmail.com>)
List pgsql-admin
On Fri, Jan 17, 2025 at 1:15 AM Siraj G <tosiraj.g@gmail.com> wrote:
Hello Experts!

The PgSQL version is 16 and it runs in Cloud SQL managed by GCP.

Problem was that we were unable to conveniently get the object details in the schema browser (within the Cloud SQL Studio) as it was getting timeout again and again. Several application jobs start to fail. Eventually we found that pg_catalog.pg_attribute was having tons of dead tuples. While vacuum on this took several hours, the problem got resolved eventually.
Command ran: vacuum pg_attribute;

I would like to understand how this issue can be prevented. We do have autovacuum ON and I could see the last vacuum on this table was just about 30hrs back.

It might be hard to figure it out now that the evidence has likely been destroyed.  When looking at when the last autovac finished, did you also happen to capture the other column values in pg_stat_sys_tables for that relname?

Look in the db server log file to see if there were failed or canceled autovacuum attempts on that table.

I would probably set log_autovacuum_min_duration to a smallish value so that if it happens again you have some evidence to look at.

Cheers,

Jeff

pgsql-admin by date:

Previous
From: Scott Ribe
Date:
Subject: release notes 17, identity columns
Next
From: jayesh thakare
Date:
Subject: pg_basebackup failing