Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A77B8B5DBC4 for ; Wed, 21 Sep 2011 04:07:07 -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 16241-03 for ; Wed, 21 Sep 2011 07:07:00 +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 E84B3B5DC13 for ; Wed, 21 Sep 2011 04:06:59 -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 4318B3B8F5; Wed, 21 Sep 2011 09:06:59 +0200 (CEST) Subject: Re: REINDEX not working for wastedspace From: Guillaume Lelarge To: AI Rumman Cc: pgsql-performance@postgresql.org Date: Wed, 21 Sep 2011 09:06:59 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1316588819.2001.0.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/309 X-Sequence-Number: 45085 On Wed, 2011-09-21 at 13:01 +0600, AI Rumman wrote: > I am using Postgresql 9.0.1. > > Using the query http://wiki.postgresql.org/wiki/Show_database_bloat, I got > the following result for a table: > > -[ RECORD 1 ]----+----------------------------------------------- > current_database | crm > schemaname | public > tablename | _attachments > tbloat | 0.9 > wastedbytes | 0 > iname | attachments_description_type_attachmentsid_idx > ibloat | 2.3 > wastedibytes | 5439488 > -[ RECORD 2 ]----+----------------------------------------------- > current_database | crm > schemaname | public > tablename | _attachments > tbloat | 0.9 > wastedbytes | 0 > iname | attachments_attachmentsid_idx > ibloat | 0.2 > wastedibytes | 0 > -[ RECORD 3 ]----+----------------------------------------------- > current_database | crm > schemaname | public > tablename | _attachments > tbloat | 0.9 > wastedbytes | 0 > iname | _attachments_pkey > ibloat | 0.2 > wastedibytes | 0 > > I REINDEXED both the indexes and table, but I did not find any change in > wastedspace or wastedispace. > Could you please tell me why? REINDEX only rebuilds indexes. And you'll obviously have a bit of "lost space" because of the FILLFACTOR value (90% on indexes IIRC). -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com