dbTalk Databases Forums  

Determining space consumed by table

comp.databases.postgresql comp.databases.postgresql


Discuss Determining space consumed by table in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mike@barrodale.com
 
Posts: n/a

Default Determining space consumed by table - 09-27-2006 , 11:13 AM






What is the most accurate way of determining how much space is
currently being utilized by a table or index? I know about looking up
the relfilenode in pg_class and then doing a Unix "du -kcs" on the file
(and any related toast files), but I'm concerned that this will report
allocated-but-unused space as well as the space that is actually used.
Is there a better way?

Many thanks,...
Mike Dunham-Wilkie


Reply With Quote
  #2  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Determining space consumed by table - 09-27-2006 , 12:36 PM






begin mike (AT) barrodale (DOT) com wrote:
Quote:
What is the most accurate way of determining how much space is
currently being utilized by a table or index? I know about looking up
http://www.postgresql.org/docs/8.1/i...ons-admin.html

pg_relation_size(text):
Disk space used by the table or index with the specified name. The table
name may be qualified with a schema name.


end
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.