Search Postgresql Archives

Re: pg_database_size differs from df -s

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



Frank Lanitz <frank@xxxxxxxxxxxxxx> writes:
> Am 06.06.2012 17:49, schrieb Tom Lane:
>> For me, pg_database_size gives numbers that match up fairly well with
>> what "du" says.  I would not expect an exact match, since du probably
>> knows about filesystem overhead (such as metadata) whereas
>> pg_database_size does not.  Something's fishy if it's off by any large
>> factor, though.  Perhaps you have some tables in a nondefault
>> tablespace, where du isn't seeing them?

> Nope. Its a pretty much clean database without any fancy stuff.

Peculiar.  If you want to put some time into it, you could try comparing
sizes table-by-table to see if you can isolate where the discrepancy is.

The only reason I can think of for du to report a size smaller than the
nominal file length (which is which the pg_xxx_size functions look at)
is if the file contains unallocated "holes".  That really shouldn't ever
happen with PG tables though.

			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


[Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Programming PHP]     [Kernel Newbies]     [PHP Classes]     [Find Someone Nice]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

Add to Google Powered by Linux