How big are those DBOs

When people talk about the size of their database it is amazing how they like to throw around that they have a table with one million rows. I find it funny that for some database admins there is a direct correlation to how many tuples a table has and how long their e-penis is. If one more person runs up to me and tell me how many rows a table has I might just have to hit them. Now that I got that out of my system lets take a look at just how big a TABLE is.

In most databases the length of a table is not that important. More curious to me is how much space is that database object taking up on the disk. The disk IO being the main bottle neck of a database you should be mind full to try and keep disk IO down. One way to do this is keep an eye on how big those INDEXES and TABLES are and try to keep them down in size. So, how big is that table? Fortunately in postgres we can easily look

SELECT relname, relpages*8*1024 as Bytes, relpages*8 as KB, (relpages*8)/1024 as MB
FROM pg_class
ORDER BY relpages DESC;

The above will show you how much space you database object are taking up. The next question is, what to you with the information? I think I answered that above. You can run around and tell folks how big your TABLE really is :-p

Leave a Reply