Calculating size of the database tables - Mailing list pgsql-admin

From akuppachi@hss.hns.com
Subject Calculating size of the database tables
Date
Msg-id OFBB94A294.8DCDB8DE-ON65256EAF.0038BA46-65256EAF.003982D8@hss.hns.com
Whole thread Raw
Responses Re: Calculating size of the database tables
List pgsql-admin



Hi,

My application uses several database tables on Postgres backend and either
a postgres or an ODBC front-end. I need to calculate the total hard disk
space occupied by the database for my application. I started out by
calculating the size of each record (row) in each table and multiplying
that with the max. expected number of entries to get this data, but
realized soon that this will not give me the full size, since many of the
tables are indexed, so index size must also be considered. Apart from that,
i read somewhere that Postgres stores 4 extra bytes per character field.

I would appreciate any pointers to finding out the correct size occupied by
my database tables. Will the physical size of the "data" folder (as given
by 'ls' command) give me the true size, or is there any other sql command
that i can use to get this information?  I am using PostgreSQL, version
7.4.1 server libraries.

TIA,
Aparna.


pgsql-admin by date:

Previous
From: "lise chhay"
Date:
Subject: My script inst/init-base didn't run
Next
From: Devrim GUNDUZ
Date:
Subject: Re: Calculating size of the database tables