Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 4485C2E0031 for ; Mon, 14 Apr 2008 06:29:45 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85683-08 for ; Mon, 14 Apr 2008 06:29:34 -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 D38B72E003B for ; Mon, 14 Apr 2008 06:29:32 -0300 (ADT) Received: (qmail 9818 invoked by uid 503); 14 Apr 2008 11:09:32 -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 11:09:32 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 14 Apr 2008 09:29:29 -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:29:28 -0000 Date: Mon, 14 Apr 2008 11:33:54 +0200 To: "Adrian Moisey" Subject: Re: db size From: PFC Cc: pgsql-performance@postgresql.org Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <4802F9E4.3000704@careerjunction.co.za> <48032237.4040604@careerjunction.co.za> Content-Transfer-Encoding: Quoted-Printable Message-ID: In-Reply-To: <48032237.4040604@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.500001/N X-Ovh-Tracer-Id: 4281797345778337328 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.827 tagged_above=0 required=5 tests=AWL=0.827 X-Spam-Level: X-Archive-Number: 200804/170 X-Sequence-Number: 29663 > >> 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 = >> test 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 hav= e = >> bloat. > > I have done that, and I get the following: > > the live one is 113G > the restored one is 78G Ah. Good news for you is that you know that you can do something ;) Now, is the bloat in the tables (which tables ?) or in the indexes (whi= ch = indexes ?), or in the toast tables perhaps, or in the system catalogs or= = all of the above ? Or perhaps there is a long-forgotten process that got= = zombified while holding a huge temp table ? (not very likely, but who = knows). Use pg_relation_size() and its friends to get an idea of the size of = stuff. Perhaps you have 1 extremely bloated table or index, or perhaps = everything is bloated. The solution to your problem depends on which case you have.