Wednesday, April 15, 2009

postgresql - How to determine the size of a database on disk

taken from: http://www.postgresonline.com/journal/index.php?/archives/110-Determining-size-of-database,-schema,-tables,-and-geometry.html

How to determine the size of a database on disk

SELECT pg_size_pretty(pg_database_size('somedatabase')) As fulldbsize;

How to determine the size of a database table on disk

NOTE: There are two functions in PostgreSQL - pg_relation_size and pg_total_relation_size. The pg_relation_size just measures the size of the actual table where as the pg_total_relation_size includes both the table and all its toasted tables and indexes.

SELECT pg_size_pretty(pg_total_relation_size('someschema.sometable')) As fulltblsize, pg_size_pretty(pg_relation_size('someschema.sometable')) As justthetblsize;

--------------

Quicksearch

" alt="Quicksearch" name="serendipity[searchButton]" title="Go!" style="width: 2em;" type="submit">

Calendar

Back April '09 Forward
Mon Tue Wed Thu Fri Sat Sun
2 3 4
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Powered by

Serendipity PHP Weblog

Wikipedia Finder


Highlight a phrase and click the icon to search on using Wikipedia.

Blog Administration

StatCounter - Free Web Tracker and Counter
Rate My Blog
BlogCatalog

No comments:

Post a Comment

cancel script completely on ctrl-c

I found this question interesting: basically how to cancel completely a script and all child processes : You do this by creating a subro...