Re: size of attributes table is too big - Mailing list pgsql-general

From Álvaro Herrera
Subject Re: size of attributes table is too big
Date
Msg-id 202503191713.6pezw2uqo2c3@alvherre.pgsql
Whole thread Raw
In response to size of attributes table is too big  (Siraj G <tosiraj.g@gmail.com>)
Responses Re: size of attributes table is too big
List pgsql-general
Hello

On 2025-Mar-19, Siraj G wrote:

> I have a PG (v16) instance which is occupying around 1TB of storage. Out of
> this, around 350GB is occupied by the table pg_catalog.pg_attribute.
> Why is the catalog table's size so big?

Heavy use of temp tables is a known cause of this.

> I think this table must have tons of dead tuples. Please suggest to me if
> we can purge any data/shrink the size of this table.

Yeah, I'd also bet that there are tons of dead tuples, or just unused
free space.  To purge it you would use VACUUM FULL, though that would
need to lock all accesses to the table.

Does your instance run with autovacuum disabled perchance?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree.              (Don Knuth)



pgsql-general by date:

Previous
From: Siraj G
Date:
Subject: size of attributes table is too big
Next
From: Pavel Stehule
Date:
Subject: Re: size of attributes table is too big