Connecting Tech Pros Worldwide Forums | Help | Site Map

need help

Newbie
 
Join Date: Dec 2006
Posts: 1
#1: Dec 10 '06
hi
iam a new member and i need a help in my porject
i need to Know how can I calculate the size of DB ,meaning caculaste the size of each table?
also I need to know if the size of the database H/W is dependent or S/W is the dependent one or both are ?
and when the DB is transferred from one computer to another does its size
change?

I hope that anyone can help me I will appreciated it and thanks anyway

The Angel

Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#2: Dec 11 '06

re: need help


The best way to calculate the size of your tables is to use the optional module dbsize, which comes with the Postgres source code, see .../contrib/dbsize
(You may or may not have it compiled/included in your Postgres installatiuon).

The size of the database between different UNIX platforms should be about the same (that is my best guess) and I have no idea how it would compare with Windows installation.

Keep in mind that size on the disk is always larger than all your data, because database needs to maintain a lot of metadata, logs, etc.
On UNIX you can see the overall size with the `du` command:

Expand|Select|Wrap|Line Numbers
  1. % cd $PGDATA
  2. postgresql % du -h
  3. 3.6M    ./base/1
  4. 3.6M    ./base/16975
  5. 4.0K    ./base/16976/pgsql_tmp
  6. 32M     ./base/16976
  7. 39M     ./base
  8. 132K    ./global
  9. 81M     ./pg_xlog
  10. 52K     ./pg_clog
  11. 120M    .
Here it's about 120 mb

Check the man pages for options to du command supported on given platform
Also keep in mind that overall size on disk may change without any changes to your data, because of either postgres internal maintenance or some user actions
(Try running "VACUUM FULL" on your db and then run `du` again to compare)

To answer all of your questions... this takes more than just yes or now... can I ask why are you concerned with all this?
Reply