Re: Improving REINDEX for system indexes (long)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improving REINDEX for system indexes (long)
Date: 2003-09-27 23:51:16
Message-ID: 200309272351.h8RNpGi24941@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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.
>
> I was toying with the notion of changing btree index build to not write
> the metapage until the index is fully built; in this way, at least the
> corrupted state of the index would be obvious. (You'd get "not a btree"
> failures.)

Oh, that's great. I can't imagine a lot of traffic in those shared
tables anyway. So you implemented all the ideas in the email --- great.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2003-09-28 00:10:21 Re: Improving REINDEX for system indexes (long)
Previous Message Tom Lane 2003-09-27 22:37:22 Re: Improving REINDEX for system indexes (long)

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2003-09-28 00:10:21 Re: Improving REINDEX for system indexes (long)
Previous Message Tom Lane 2003-09-27 23:41:08 Re: Can't Build 7.3.4 on OS X

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-09-27 23:52:41 Re: fix log_min_duration_statement logic error
Previous Message Tom Lane 2003-09-27 22:37:22 Re: Improving REINDEX for system indexes (long)