Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQede-0005cx-12 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 14:07:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQedd-0006nS-IA for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 14:07:37 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQedc-0006nN-VL for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 14:07:37 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQedV-0002x3-HA for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 14:07:36 +0000 Received: from intern.anarazel.de (p5DDC5889.dip.t-dialin.net [93.220.88.137]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id EBC774F0001; Fri, 12 Apr 2013 16:07:27 +0200 (CEST) Date: Fri, 12 Apr 2013 16:07:27 +0200 From: Andres Freund To: daniel@heroku.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8058: CLUSTER and VACUUM FULL fail to free space Message-ID: <20130412140727.GG5766@alap2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2013-04-12 08:34:24 +0000, daniel@heroku.com wrote: > The following bug has been logged on the website: > > Bug reference: 8058 > Logged by: Daniel Farina > Email address: daniel@heroku.com > PostgreSQL version: 9.0.13 > Operating system: Ubuntu 10.04 > Description: > > We have a somewhat high-churn table acting as a queue, and over time it's > grown to be something like a gigabyte. I surmised it might be vanilla > bloat, but the truth seems somewhat more exotic because both VACUUM FULL and > CLUSTER generated absolutely no new free space. > > In the end, ALTER TABLE and CREATE TABLE ... (LIKE) ran nearly instantly and > got the table size down to a few hundred K from 900M. > > This caused quite a few problems because would normally be cheap index scan > over a mere 100 tuples were taking a few seconds. > > There are TOASTed fields on this table, ranging in a few hundred bytes of > text per attribute. > > We have retained the old bloated table so we can poke at it. Could it be that you have old transactions around? That would explain the issue since CLUSTER et al. will preserve rows that are still visible to some existing transaction while CREATE TABLE ... LIKE won't. Typical suspects would be longrunning (idle in) transactions or prepared transactions. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs