Re: Improving REINDEX for system indexes (long) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Improving REINDEX for system indexes (long)
Date
Msg-id 20030928001021.GA9141@dcc.uchile.cl
Whole thread Raw
In response to Re: Improving REINDEX for system indexes (long)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Improving REINDEX for system indexes (long)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Sep 27, 2003 at 06:37:22PM -0400, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom, would you summarize what REINDEX currently _doesn't_ do?
> 
> As of CVS tip I think the only deficiency is that indexes on the shared
> catalogs (pg_database, pg_shadow, pg_group) have to be reindexed in
> place, rather than being rebuilt with a new relfilenode as is done for
> CLUSTER or TRUNCATE.  In-place reindexing isn't crash-safe, since if
> you fail you're left with a half-built (effectively corrupt) index.
> 
> I don't see any way to avoid that, though, since we cannot change the
> relfilenode value for a shared index.

What about creating a separate filenode anyway and renaming the files
afterwards?  It would not be an atomic operation anyway, but it would be
better than the current setup IMHO.

(It seems unlikely that one would have > 1GB indexes for shared
relations...)

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La espina, desde que nace, ya pincha" (Proverbio africano)


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Improving REINDEX for system indexes (long)
Next
From: Tom Lane
Date:
Subject: Re: Improving REINDEX for system indexes (long)