Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 187EE64FD10 for ; Thu, 14 Aug 2008 05:30:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33305-07 for ; Thu, 14 Aug 2008 05:30:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailout02.ims-firmen.de (mailout02.ims-firmen.de [213.174.32.97]) by postgresql.org (Postfix) with ESMTP id 45B9264FCCB for ; Thu, 14 Aug 2008 05:30:12 -0300 (ADT) Received: from mailin04.ims-firmen.de ([192.168.1.113]) by mailout02.ims-firmen.de with esmtp (Exim 4.69) (envelope-from ) id 1KTYDh-0004PP-9c; Thu, 14 Aug 2008 10:30:09 +0200 Received: from [213.174.32.254] (helo=localhost) by mailin04.ims-firmen.de with esmtpa (Exim 4.69) (envelope-from ) id 1KTYDh-0008RS-99; Thu, 14 Aug 2008 10:30:09 +0200 Date: Thu, 14 Aug 2008 10:30:07 +0200 From: Thomas Jacob To: steve@outtalimits.com.au Cc: pgsql-admin@postgresql.org Subject: Re: DB Dump Size Message-ID: <20080814083003.GA456@internet24.de> References: <326684d8c021f4afb82f8e921f9e0c40@127.0.0.1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dc+cDN39EJAMEtIO" Content-Disposition: inline In-Reply-To: <326684d8c021f4afb82f8e921f9e0c40@127.0.0.1> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/54 X-Sequence-Number: 29899 --dc+cDN39EJAMEtIO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 14, 2008 at 12:06:53PM +1000, steve@outtalimits.com.au wrote: > Hi all, >=20 > I am curious as to why a pg dump of database "name" is 2.9gig. But is > measured at 1.66gig by: > SELECT pg_database_size(pg_database.datname) AS db_size FROM pg_database > WHERE pg_database.datname=3D'name' ; >=20 > This dump was about 1 gig around 12 months ago. Which options do you use for pg_dump? And what version of PosgreSQL are you running? In general it's not that strange for an uncompressed dump to be larger than the database size, plain SQL dumps are much less space efficient than a DBMS can be when it stores the data on disk. But of course, there also indices to consider. Have you tried pg_dump -Fc? > I am performing a monthly vacuum full on the database and a nightly vacuum > all That should only impact the pg_database_size. --dc+cDN39EJAMEtIO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIo+0PgF9cFv867HwRAv8gAJ91DGn9dUNiZ2KqRxNJpBrIlhrlCACcCG/h XZOnKwuRDVF2FLyjsHwM0/Q= =cywT -----END PGP SIGNATURE----- --dc+cDN39EJAMEtIO--