Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id AFF9A9FA25B for ; Wed, 17 Jan 2007 11:43:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 79595-06 for ; Wed, 17 Jan 2007 11:43:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 8C5FA9F9FDA for ; Wed, 17 Jan 2007 11:43:06 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-100-202.bk7-dsl.surnet.cl [200.126.100.202]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l0HFgxMq030804; Wed, 17 Jan 2007 07:43:04 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8113B32A0B; Wed, 17 Jan 2007 12:42:51 -0300 (CLST) Date: Wed, 17 Jan 2007 12:42:51 -0300 From: Alvaro Herrera To: Bill Moran Cc: pgsql-general@postgresql.org Subject: Re: Index bloat of 4x Message-ID: <20070117154251.GG26080@alvh.no-ip.org> Mail-Followup-To: Bill Moran , pgsql-general@postgresql.org References: <20070117093223.bcdb302e.wmoran@collaborativefusion.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070117093223.bcdb302e.wmoran@collaborativefusion.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Wed, 17 Jan 2007 07:43:04 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/902 X-Sequence-Number: 107442 Bill Moran wrote: > > We just did a bunch of maintenance on one of our production databases that > involved a lot of alter tables and moving records about and the like. > > Afterwards, I did a vacuum full and analyze to get the database back on > track -- autovac maintains it under normal operations. > > Today I decided to run reindex during a slow period, and was shocked to > find the database size drop from 165M to 30M. Keep in mind that the > 165M is after vacuum full. So, apparently, there was 135M of index bloat? > That seems a little excessive to me, especially when the docs claim that > reindexing is usually not necessary. It's been said that vacuum full does not fix index bloat -- in fact, it's a problem it worsens. However, I very much doubt that it would be this serious. I guess the question is, how large was the index *before* all the alter tables? I'd expect that it was the ALTER TABLEs that caused this much index growth, which VACUUM FULL was subsequently unable to fix. I don't expect you kept a log of index sizes throughout the operation however :-( -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support