Search Postgresql Archives

Re: Disk space usage discrepancy

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

 



Yang Zhang <yanghatespam@xxxxxxxxx> writes:
> We're trying to figure out how to account for our disk space
> consumption in a database.

> $ sudo du -shx /var/lib/postgresql/8.4/main/
> 1.9G    /var/lib/postgresql/8.4/main/

> But when we query Postgresql to find out how much disk space is
> actually being used by the various databases, we get a total of under
> 600MB (the exact query we use for determining this is below, derived
> from the example query in the PG documentation):

>         select sum(pg_relation_size(oid)) from pg_class where relkind = 'r'

I think you need pg_total_relation_size() if you're doing it that way.
As is, you're missing out indexes and toast tables, and possibly also
secondary forks (I forget if 8.4 had those).

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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