Re: why is pg_dump so much smaller than my database?

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: why is pg_dump so much smaller than my database?
Date: 2012-03-29 08:13:17
Message-ID: CAF-3MvNmd-zoGSxqRLYbHLfT8U23kq8N+K_ib-dyZpCcpNccZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29 March 2012 09:11, John R Pierce <pierce(at)hogranch(dot)com> wrote:
> On 03/28/12 10:32 PM, Carson Gross wrote:
>>
>> I've got a pretty big database (~30 gigs) and when I do a pg_dump, it ends
>> up only being 2 gigs.

I suppose you're talking about a plain text dump here? A compressed
dump would likely[*] be quite a bit smaller than your database.

And as John already says, deleted tuples do not get dumped, neither do
index contents. Any fill-factors defined on tables or indexes would
also account for a difference in size.

*: This does depend on what data you store, of course. A database that
mainly consists of stored JPEG images, for example, wouldn't compress
much. A database with the same text data over and over would compress
immensely.
--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2012-03-29 08:16:23 Re: system catalog privilege and create privilege ??? how to control them?? thanks
Previous Message John R Pierce 2012-03-29 07:11:57 Re: why is pg_dump so much smaller than my database?