X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F0B1F9DC94A for ; Sun, 26 Mar 2006 19:54:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10542-02 for ; Sun, 26 Mar 2006 19:54:51 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by postgresql.org (Postfix) with ESMTP id CE32E9DC854 for ; Sun, 26 Mar 2006 19:54:45 -0400 (AST) Received: by zproxy.gmail.com with SMTP id i11so1255292nzh for ; Sun, 26 Mar 2006 15:54:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=KMo4cQ9brL/e/t447JXCQdioyCWRS9wyuO4O2XoGZqOmzdDsTewzVmsZi+uzxIMWkC0LlFCtZ1OT4EdrkHf/zyrcvjs/NS2Ftz1PkTj9sXezqhup0ui1lPWrH6uPfr/OrZekDe63/XL+RRs8cN7OtE9pcFyg+30+1vHq1JCOcFg= Received: by 10.65.251.12 with SMTP id d12mr1958646qbs; Sun, 26 Mar 2006 15:54:48 -0800 (PST) Received: by 10.65.53.2 with HTTP; Sun, 26 Mar 2006 15:54:48 -0800 (PST) Message-ID: <1c66bda80603261554q25067e3fr46173cc5049be9f8@mail.gmail.com> Date: Mon, 27 Mar 2006 11:54:48 +1200 From: adey To: "Tom Lane" Subject: Re: Bloated pg_shdepend_depender_index Cc: "Peter Eisentraut" , pgsql-admin@postgresql.org, "Gregory Maxwell" In-Reply-To: <4553.1143212521@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4064_25839271.1143417288803" References: <27588.1143175698@sss.pgh.pa.us> <200603241150.20021.peter_e@gmx.net> <4553.1143212521@sss.pgh.pa.us> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.49 required=5 tests=[AWL=0.489, HTML_MESSAGE=0.001] X-Spam-Score: 0.49 X-Spam-Level: X-Archive-Number: 200603/279 X-Sequence-Number: 21036 ------=_Part_4064_25839271.1143417288803 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline In vacuum full output, indexes are listed as having been vacuumed along wit= h their table. Have I misinterpreted this message saying that vacuum is incapable of vacuuming indexes (and reindex is the only option to do so) please? On 3/25/06, Tom Lane wrote: > > Peter Eisentraut writes: > > Am Freitag, 24. M=E4rz 2006 05:48 schrieb Tom Lane: > >> Well, the VACUUM FULL algorithm is incapable of shrinking indexes --- > >> the only way is REINDEX, or something else that reconstructs indexes > >> from scratch, such as CLUSTER. One of the things we need to look into > >> is putting more smarts into VACUUM so that it automatically does > >> something reasonable when faced with extreme cases like these. > > > If the user is running VACUUM FULL, he has presumably determined that > the > > table is too bloated to be recovered in a graceful way, and quite likel= y > the > > indexes are going to be bloated similarly. So seemingly one might as > well > > launch a reindexing on the table after VACUUM FULL has done its thing. > > Whether that should be automatic is another question but perhaps the > advice > > should be documented somewhere? > > Actually, I wonder whether VACUUM FULL shouldn't be thrown away and > replaced by something else entirely. That algorithm only really works > nicely when just a small percentage of the rows need to be moved to > re-compact the table --- if you're moving lots of rows, it makes the > index bloat situation *worse* not better because of the transient need > for index entries pointing to both copies of moved rows. Lazy VACUUM > has become the de-facto standard for situations where there's not a huge > amount of empty space, and so it's not clear where the sweet spot is for > VACUUM FULL anymore. If you've got enough disk space, a rewrite (like > CLUSTER or ALTER TABLE) is going to blow the doors off VACUUM FULL, > let alone VACUUM FULL plus REINDEX. Not to mention that for > sufficiently huge tables, VACUUM FULL fails outright because it runs out > of RAM. > > We need to fix CLUSTER to make it MVCC-safe (ie, not discard > recently-dead rows), and it'd be nice to have something like it that > didn't worry about ordering but just did a seqscan of the source table. > Then I'd be inclined to recommend that instead of VACUUM FULL for most > cases of severe bloat. > > Unfortunately this all breaks down for shared system catalogs and the > core (nailed-in) catalogs, because we can't change their relfilenodes > and so the crash-safe CLUSTER/REINDEX approach doesn't work. We still > need a new idea or two there. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > ------=_Part_4064_25839271.1143417288803 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
In vacuum full output, indexes are listed as having been vacuumed alon= g with their table.
Have I misinterpreted this message saying that vacuum is incapable of = vacuuming indexes (and reindex is the only option to do so) please?

=  
On 3/25/06, = Tom Lane <tgl@sss.pgh.pa.us= > wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Freitag,= 24. M=E4rz 2006 05:48 schrieb Tom Lane:
>> Well, the VACUUM FULL algorithm is incapable of shrinking inde= xes ---
>> the only way is REINDEX, or something else that reconst= ructs indexes
>> from scratch, such as CLUSTER.  One of = the things we need to look into
>> is putting more smarts into VACUUM so that it automatically do= es
>> something reasonable when faced with extreme cases like thes= e.

> If the user is running VACUUM FULL, he has presumably determ= ined that the
> table is too bloated to be recovered in a graceful way, and quite = likely the
> indexes are going to be bloated similarly.  So= seemingly one might as well
> launch a reindexing on the table after= VACUUM FULL has done its thing.
> Whether that should be automatic is another question but perhaps t= he advice
> should be documented somewhere?

Actually, I wonder= whether VACUUM FULL shouldn't be thrown away and
replaced by something = else entirely.  That algorithm only really works
nicely when just a small percentage of the rows need to be moved to
= re-compact the table --- if you're moving lots of rows, it makes the
ind= ex bloat situation *worse* not better because of the transient need
for index entries pointing to both copies of moved rows.  Lazy VA= CUUM
has become the de-facto standard for situations where there's not a= huge
amount of empty space, and so it's not clear where the sweet spot = is for
VACUUM FULL anymore.  If you've got enough disk space, a rewr= ite (like
CLUSTER or ALTER TABLE) is going to blow the doors off VACUUM = FULL,
let alone VACUUM FULL plus REINDEX.  Not to mention that= for
sufficiently huge tables, VACUUM FULL fails outright because it run= s out
of RAM.

We need to fix CLUSTER to make it MVCC-safe (ie, not dis= card
recently-dead rows), and it'd be nice to have something like it tha= t
didn't worry about ordering but just did a seqscan of the source table= .
Then I'd be inclined to recommend that instead of VACUUM FULL for most<= br>cases of severe bloat.

Unfortunately this all breaks down for sha= red system catalogs and the
core (nailed-in) catalogs, because we can't = change their relfilenodes
and so the crash-safe CLUSTER/REINDEX approach doesn't work.  = ;We still
need a new idea or two there.

    &= nbsp;           &nbs= p;      regards, tom lane

-----------------= ----------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

------=_Part_4064_25839271.1143417288803--