Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 0416E2E003A for ; Mon, 14 Apr 2008 06:14:07 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 77697-05 for ; Mon, 14 Apr 2008 06:13:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from 27.mail-out.ovh.net (27.mail-out.ovh.net [91.121.30.210]) by developer.postgresql.org (Postfix) with SMTP id C7D422E004D for ; Mon, 14 Apr 2008 06:13:57 -0300 (ADT) Received: (qmail 5781 invoked by uid 503); 14 Apr 2008 10:53:58 -0000 Received: from gw2.ovh.net (HELO mail174.ha.ovh.net) (213.251.189.202) by 27.mail-out.ovh.net with SMTP; 14 Apr 2008 10:53:58 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 14 Apr 2008 09:13:56 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13.peufeu.com) (88.161.102.87) by ns0.ovh.net with SMTP; 14 Apr 2008 09:13:53 -0000 Date: Mon, 14 Apr 2008 11:18:19 +0200 To: "Adrian Moisey" , pgsql-performance@postgresql.org Subject: Re: db size From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <4802F9E4.3000704@careerjunction.co.za> Content-Transfer-Encoding: Quoted-Printable Message-ID: In-Reply-To: <4802F9E4.3000704@careerjunction.co.za> User-Agent: Opera Mail/9.24 (Linux) X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Ovh-Tracer-Id: 4018899717859313200 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.829 tagged_above=0 required=5 tests=AWL=0.829 X-Spam-Level: X-Archive-Number: 200804/168 X-Sequence-Number: 29661 > Hi > > 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? I have a 2GB database, which dumps to a 340 MB file... Two reasons : - I have lots of big fat but very necessary indexes (not included in du= mp) - Dump is compressed with gzip which really works well on database data= . If you suspect your tables or indexes are bloated, restore your dump to= a = test box. Use fsync=3Doff during restore, you don't care about integrity on the t= est = box. This will avoid slowing down your production database. Then look at the size of the restored database. If it is much smaller than your production database, then you have bloa= t. Time to CLUSTER, or REINDEX, or VACUUM FULL (your choice), on the table= s = that are bloated, and take note to vacuum those more often (and perhaps = = tune the autovacuum). Judicious use of CLUSTER on that small, but extremely often updated tab= le = can also be a very good option. 8.3 and its new HOT feature are also a good idea.