Re: Difference in DB size with dump and pg_database_size

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: condor(at)stz-bg(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Difference in DB size with dump and pg_database_size
Date: 2011-07-05 08:43:38
Message-ID: CABUevEzCgEBUUWn8cKj=p1TbZxjAZv-68CVDqGNFAVzU-NESRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 5, 2011 at 10:38, Condor <condor(at)stz-bg(dot)com> wrote:
> Hello,
> any one can explain me why I have difference between db size when I dump db,
> I see it's 5G and when I run SELECT
> pg_size_pretty(pg_database_size('somedatabase')) As fulldbsize; on my DB
> postgresql return: 10 GB
>
> I run vacuum on db every night. Why is that huge difference in size ?

The dump does not include indexes - for each index it just contains
the CREATE INDEX statement, not the actual data in the index.

And perhaps you've also compressed your dumps? Though in that case,
the difference would probably be bigger...

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Condor 2011-07-05 09:00:45 Dump large DB and restore it after all.
Previous Message Condor 2011-07-05 08:38:57 Difference in DB size with dump and pg_database_size