From: Daniel Farina <daniel@heroku.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #8058: CLUSTER and VACUUM FULL fail to free space
Date: Fri, 12 Apr 2013 10:56:39 -0700
Message-ID: <CAAZKuFb=DBLDsmJm8qgLxtr8fSdcpbSkv8LPhoiDryCShuYLFw@mail.gmail.com> (raw)
In-Reply-To: <CAAZKuFYS=wm1xFQp2uN-MEPiRXehZqsS8bqCPon5gVM8svbyzQ@mail.gmail.com>
References: <E1UQZRA-00023J-ED@wrigleys.postgresql.org>
<20130412140727.GG5766@alap2.anarazel.de>
<CAAZKuFYS=wm1xFQp2uN-MEPiRXehZqsS8bqCPon5gVM8svbyzQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Fri, Apr 12, 2013 at 10:46 AM, Daniel Farina <daniel@heroku.com> wrote:
> On Fri, Apr 12, 2013 at 7:07 AM, Andres Freund <andres@2ndquadrant.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: daniel@heroku.com, andres@2ndquadrant.com
Subject: Re: BUG #8058: CLUSTER and VACUUM FULL fail to free space
In-Reply-To: <CAAZKuFb=DBLDsmJm8qgLxtr8fSdcpbSkv8LPhoiDryCShuYLFw@mail.gmail.com>
References: <E1UQZRA-00023J-ED@wrigleys.postgresql.org> <20130412140727.GG5766@alap2.anarazel.de> <CAAZKuFYS=wm1xFQp2uN-MEPiRXehZqsS8bqCPon5gVM8svbyzQ@mail.gmail.com> <CAAZKuFb=DBLDsmJm8qgLxtr8fSdcpbSkv8LPhoiDryCShuYLFw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox