Re: Improving REINDEX for system indexes (long)

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-28 18:15:53
Message-ID: 20030928181553.GA5512@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-patches

On Sat, Sep 27, 2003 at 08:18:07PM -0400, Bruce Momjian wrote:
> Tom Lane wrote:
> > > 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.
> >
> > I think it would be difficult to persuade the buffer manager and storage
> > manager to work with this; from their point of view you'd be moving a
> > relation underneath them. I doubt it's really worth the trouble; how
> > often do you need to reindex a shared catalog?
>
> The point I missed originally is that he is talking about shared
> catalogs, not system catalogs, which work fine in CVS.

Well, my idea was to reduce the window of time during which the index
would be corrupt, i.e. not completely rebuilt. This is only an issue
with shared indexes, because other system indexes do use the changing
relfilenode thingie already.

However, the main reason for reindexing is a corrupt index, so if for
some reason the new index is also corrupt (e.g. the machine crashes
midway) there's no point in having a separate index filenode anyway.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2003-09-28 23:26:20 pgsql-server/src include/access/xact.h backend ...
Previous Message Jan Wieck 2003-09-28 17:46:20 pgsql-server/src/bin/pg_dump Tag: REL7_3_STABL ...

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-09-28 18:29:01 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Previous Message Jan Wieck 2003-09-28 17:48:01 Re: pg_dump doesn't dump binary compatible casts

Browse pgsql-patches by date

  From Date Subject
Next Message Hiroshi Inoue 2003-09-28 23:50:09 Re: pgsql-server/src/backend catalog/index.c comma ...
Previous Message Tom Lane 2003-09-28 15:36:54 Re: pgsql-server/src/backend catalog/index.c comma ...