Search Postgresql Archives

table disk space usage query?

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

 



Hello all -

I was looking for a way to find out how much disk space each table is
using.

I stumbled upon this page ( http://www.ffnn.nl/pages/articles/linux/postgresql-tips-and-tricks.php
) which gave me a query to show the number of disk pages per object.
Given that a page is 8kb, I added these calculated columns to the
query:

SELECT relname, reltuples, relpages,
relpages * 8 AS relpagesKB,
(relpages * 8 )/1024 AS relpagesMB
FROM pg_class ORDER BY relpages DESC ;

Is this correct?



[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