Re: pg_database_size differs from df -s

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: pg_database_size differs from df -s
Дата
Msg-id CAOBaU_b5ebGuap9QM6Z2ry-yKdyDaiCxu8s2ChAV=Yc-PoHyfA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_database_size differs from df -s  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_database_size differs from df -s  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgsql-general


On Wed, Jun 6, 2012 at 6:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Frank Lanitz <frank@frank.uvena.de> 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.


Perhaps with the contrib adminpack you may easily find where it comes from comparing size from pg_table_size and pg_stat_file ?
 
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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Lonni J Friedman
Дата:
Сообщение: Re: pg_basebackup blocking all queries
Следующее
От: Efraín Déctor
Дата:
Сообщение: Renumber table rows