Re: size of attributes table is too big

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Siraj G <tosiraj(dot)g(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: size of attributes table is too big
Date: 2025-03-19 17:17:10
Message-ID: ba80fa8c-4038-463c-b134-d7e7b46601c4@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/19/25 10:06, Siraj G wrote:
> Hello!
>
> I have a PG (v16) instance which is occupying around 1TB of storage. Out

Exact version of Postgres 16, include the x in 16.x.

> of this, around 350GB is occupied by the table pg_catalog.pg_attribute.
> Why is the catalog table's size so big?
>
> Here are the sizes:

How did you measure the sizes?

pg_attribute maintains information about table columns, how many table
columns do you have?

Are you creating/dropping tables on a regular basis?

Is autovacuum running properly?

Have you run VACUUM manually on pg_attribute?

>
> pg_attribute
>
> 338 GB
> pg_attribute_relid_attnam_index
>
> 117 GB
> pg_attribute_relid_attnum_index
>
> 69 GB
>
>
> 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.
>
> REgards
> Siraj

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-03-19 17:22:47 Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Previous Message Pavel Stehule 2025-03-19 17:16:57 Re: size of attributes table is too big