Re: pg_database_size differs from df -s

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Frank Lanitz <frank(at)frank(dot)uvena(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_database_size differs from df -s
Date: 2012-06-06 19:22:45
Message-ID: 1339010565.1842.0.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2012-06-06 at 18:46 +0200, Julien Rouhaud wrote:
> On Wed, Jun 6, 2012 at 6:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> > Frank Lanitz <frank(at)frank(dot)uvena(dot)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 ?
>

You don't need the adminpack extension to use pg_stat_file. pg_stat_file
is in PostgreSQL core.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Viktor Rosenfeld 2012-06-06 19:40:25 Query runtime dependent on ANALYZE run
Previous Message Alban Hertroys 2012-06-06 18:31:36 Re: pg_database_size differs from df -s