Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 7EC9A6329D1 for ; Wed, 5 May 2010 09:01:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 75517-09 for ; Wed, 5 May 2010 12:01:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id 4CA04632950 for ; Wed, 5 May 2010 09:01:36 -0300 (ADT) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id o45C1YNO022734 for ; Wed, 5 May 2010 15:01:34 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id o45C1Xc9022733 for pgsql-admin@postgresql.org; Wed, 5 May 2010 15:01:33 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-admin@postgresql.org Subject: Re: Table space grow big - PostgreSQL Date: Wed, 5 May 2010 15:01:33 +0300 User-Agent: KMail/1.9.7 References: <4BE1140602000025000312C9@gw.wicourts.gov> In-Reply-To: <4BE1140602000025000312C9@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201005051501.33619.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.451 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201005/53 X-Sequence-Number: 34526 =CE=A3=CF=84=CE=B9=CF=82 Wednesday 05 May 2010 14:45:26 =CE=BF/=CE=B7 Kevin= Grittner =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > Khangelani Gama wrote: > =20 > > /usr/local/pgsql/data/base directory shows the following where > > 95186722/ takes a lot of space : >=20 > > 51G ./95186722 >=20 > > Now the dump file of the very same database created by using > > command : pg_dump -U user -O dbname > /tmp/filename is 2.8G big. > =20 > > The main question I have is: What makes the > > /usr/local/pgsql/data/base/95186722/ grow so big while the actual > > data with its schema is only 2.8G and that is there a way to reduce > > the table space sizes or anything related to that? > =20 > The size of a dump is often somewhat smaller than the raw data, but > this extreme difference suggests that your tables are bloated due to > inadequate routine maintenance. What version of PostgreSQL is this?=20 > What is your vacuum policy? Please show the contents of your > postgresql.conf file with all comments stripped. > =20 It depends, in the case of indexes, one SQL CREATE INDEX statement could re= sult to many megs of memory on disk, while, on the other hand, binary content (a bytea holding e.g. image bitmap= s) will have bigger size in the dump rather than on disk's raw data, since it is compressed there. In our case the dump is twice the size of the db on disk, but generally i t= hink there cant be no universal rule of what is larger than what. > -Kevin >=20 >=20 =2D-=20 Achilleas Mantzios