Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8F063B5DC63 for ; Wed, 14 Sep 2011 09:00:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 39614-10 for ; Wed, 14 Sep 2011 12:00:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id 670CCB5DC4F for ; Wed, 14 Sep 2011 09:00:16 -0300 (ADT) Received: from [192.168.42.162] (LCaen-151-93-7-26.w80-13.abo.wanadoo.fr [80.13.230.26]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id BE1433B8F5; Wed, 14 Sep 2011 14:00:15 +0200 (CEST) Subject: Re: database size much bigger than tablespaces on filesystem From: Guillaume Lelarge To: Rob Audenaerde Cc: "pgsql-admin@postgresql.org" Date: Wed, 14 Sep 2011 14:00:15 +0200 In-Reply-To: <1D020918205F334CBDD5CE7DF2038A2E15A5812457@IE2RD2XVS271.red002.local> References: <1D020918205F334CBDD5CE7DF2038A2E15A5812457@IE2RD2XVS271.red002.local> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1316001615.2110.13.camel@localhost.localdomain> Mime-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.324 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_NJABL_PROXY=2.224 X-Spam-Level: X-Archive-Number: 201109/97 X-Sequence-Number: 38334 On Wed, 2011-09-14 at 04:03 -0700, Rob Audenaerde wrote: > I have a Postgresql 8.3 instance with tablespaces totalling on about 74G. This is fine. > > But if I ask Postgresql how big my database is, I get a (unexpected) large answer: 595 GB. > > This seems very strange. Disk I/O tests on the system are in the 'normal' range, but queries are slower than they used to be. > > Is this corruption of the database? Or are there ways to 'fix' this oddity? > > Btw: > > I check the tablespace size by the os: > > /usr/local/pgsql/data/tblspaces/du -c -h > 74G total > > All tablespaces are there. I check this by the \db command in pgsql > > I check te database size like this: > > select pg_size_pretty(pg_database_size('database')) > 595 GB You should also check the space held in $PGDATA/base. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com