Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQiE6-0007en-3V for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:57:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQiE5-0006If-Id for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:57:29 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQiE4-0006Hn-Eq for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:57:28 +0000 Received: from mail-ie0-x232.google.com ([2607:f8b0:4001:c03::232]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQiDy-00072K-7i for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:57:27 +0000 Received: by mail-ie0-f178.google.com with SMTP id bn7so3621201ieb.37 for ; Fri, 12 Apr 2013 10:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:x-gm-message-state; bh=jDIATIr6YHyzLy8+yOs/5QW0lB/HhBmKlgCP4tDjV9c=; b=QZeiA60DimfelnRSRGBfMWCNMNmps2QKsroRQCp2i1K1wc3jsYfehILyNHKrq2lwyu fwDPS8g0/Qrl9VMhhsaPqa0RBamYMex2LTkqxV7TEpPj/2K6LmbHsNxe17kzc3V6b0vc U/48WXy5e7718jOMrkZd0fRWMm+AhKOz2d2h+CuIhg5w038tHWZl+uSTHpCUyE8zRPPi UksrbU7+3ciKx3mglqM4WrunZ5CLFlLRyYmjPGGWLuypFem0gdER8k40rBKkZ1qmz4iQ AxLVRMYlbcAP9QSwHGLWzT1mi+E85qz9RncJmnMBMFNGJzemGV77tE4mbQ9F/cx57zZ3 W3pw== X-Received: by 10.50.153.232 with SMTP id vj8mr2519729igb.2.1365789439966; Fri, 12 Apr 2013 10:57:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.192.196 with HTTP; Fri, 12 Apr 2013 10:56:39 -0700 (PDT) In-Reply-To: References: <20130412140727.GG5766@alap2.anarazel.de> From: Daniel Farina Date: Fri, 12 Apr 2013 10:56:39 -0700 Message-ID: Subject: Re: BUG #8058: CLUSTER and VACUUM FULL fail to free space To: Andres Freund Cc: "pgsql-bugs@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnK+/neq7+dh4xmZ9kPo2tfel8hLI3dT4UHNL8wH+PnBaY2dggJyDHXViPpAq9oITp0TuF2 X-Pg-Spam-Score: -1.9 (-) 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 Fri, Apr 12, 2013 at 10:46 AM, Daniel Farina wrote: > On Fri, Apr 12, 2013 at 7:07 AM, Andres Freund wrote: >> 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. > > You are right, except it's once-removed: at some point we've turned on > hot standby feedback to try to assuage some complaints about follower > lag knowing that this general class of symptom was possible, and this > is almost certainly the cause. Clearly, I didn't remember that or > think to check this time. > > Sorry about the mis-report. Oh yeah, and one more thing: somehow I was under the unsubstantiated impression that VACUUM FULL/CLUSTER would wait for xmin to pass (like DDL) when in operation, but in retrospect there's no reason why that need be the case. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs