Search Postgresql Archives

Re: Disk space occupied by a table in postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 09, 2008 at 12:18:46AM -0700, aravind chandu wrote:
>                     I installed postgresql on linux system, I create a
>                     table and inserted a large data into the table
>                     what I would like to know is how to calculate the
>                     disk space occupied by the table .Is there any
>                     procedure to find it out or simply a command
>                     .Please give me some suggestion.

select pg_relation_size('table_name');
or
select pg_total_relation_size('table_name');

both return size in bytes.

pg_total_relation_size includes disk space used by indexes and external
storage (long texts are kept not in table datafile, but in separate
"toast" tables).

Best regards,

depesz

-- 
Linked in: http://www.linkedin.com/in/depesz
jid/gtalk: depesz@xxxxxxxxxx
aim:       depeszhdl
skype:     depesz_hdl


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux