primary key size is huge - Mailing list pgsql-admin

From Mackay, Beth (ES)
Subject primary key size is huge
Date
Msg-id 54c2e6ed979a4d3386ad3202e17fc662@XCGVAG26.northgrum.com
Whole thread Raw
Responses Re: primary key size is huge  (Alvaro Aguayo Garcia-Rada <aaguayo@opensysperu.com>)
List pgsql-admin
My customer is concerned about the amount of RAM being used on their database server. 
 
I have a table with 172 GB of data, and it has a corresponding primary key, which also has 49 GB of data.  I found the sizes of the data using the "Finding the size of your biggest relations" section of this wiki: https://wiki.postgresql.org/wiki/Disk_Usage

I’m running PostgreSQL 8.1.9 (I know, it’s ancient and long past end of life but I can’t get my customer to upgrade).  They are running the autovacuum process.
 
Is that size primary key table expected?  If I have another copy of the database, this time with 93 MB of data in my table, it still has a corresponding 27 MB primary key.  Another curious thing is that sometimes I have no data in the table, but the primary key is still 21 MB.  In the case with no data in the table, data may have been in the table at one point but has since been deleted.
 
Would these large primary keys have any impact on the RAM used by the server?  Is there some way to reduce their sizes? 
 
Thanks,
Beth MacKay
 
 
 

pgsql-admin by date:

Previous
From: "Pavlov, Vladimir"
Date:
Subject: Re: MultiXact member wraparound protections
Next
From: Alvaro Aguayo Garcia-Rada
Date:
Subject: Re: primary key size is huge