Re: db size - Mailing list pgsql-performance

From Bill Moran
Subject Re: db size
Date
Msg-id 20080414091212.f73eb101.wmoran@collaborativefusion.com
Whole thread Raw
In response to db size  (Adrian Moisey <adrian@careerjunction.co.za>)
List pgsql-performance
In response to Adrian Moisey <adrian@careerjunction.co.za>:
>
> We currently have a 16CPU 32GB box running postgres 8.2.
>
> When I do a pg_dump with the following parameters "/usr/bin/pg_dump -E
> UTF8 -F c -b" I get a file of 14GB in size.
>
> But the database is 110GB in size on the disk.  Why the big difference
> in size?  Does this have anything to do with performance?

In a dump, indexes are a single command.  In the actual database, the
indexes actually contain all the data the indexes require, which can
be substantially more in size than the command to create the index.

Additionally, a running database has a certain amount of wasted space.
If you're running vacuum on a proper schedule, this won't get out of
hand.  Read this page to understand better:
http://www.postgresql.org/docs/8.1/static/maintenance.html

And lastly, I expect that the pg_dump format is able to do more aggressive
compression than the running database.

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: shared_buffers performance
Next
From: Greg Smith
Date:
Subject: Re: shared_buffers performance