Re: size of attributes table is too big

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Siraj G <tosiraj(dot)g(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: size of attributes table is too big
Date: 2025-03-19 17:13:44
Message-ID: 202503191713.6pezw2uqo2c3@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2025-03-19 17:16:57 Re: size of attributes table is too big
Previous Message Siraj G 2025-03-19 17:06:08 size of attributes table is too big