Re: [HACKERS] Index recreation in vacuum - Mailing list pgsql-hackers

From Dmitry Samersoff
Subject Re: [HACKERS] Index recreation in vacuum
Date
Msg-id 3884BF59.81329C8E@wplus.net
Whole thread Raw
In response to Re: [HACKERS] Index recreation in vacuum  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] Index recreation in vacuum
Re: [HACKERS] Index recreation in vacuum
List pgsql-hackers
Bruce Momjian wrote:

> >
> > The problem is how to invalidate/validate indexes.
> > Of cource natural way is to drop/create indexes but the
> > definition of indexes would be lost in case of abort/crash.
>
> My idea would be to create a new index that is a random index name.
> Then, do rename(), which is an atomic OS operation putting the new index
> file in place of the old name.  Seems that would work well.

Yes, but it can cause disk space problem for very large indices.
Moreover,  you need firts unlink old index file than do rename(),
it is not atomic.
 May be better way is to create tmp file containing index description,
undestandable for vacuum.

--
Dmitry Samersoff, DM\S
dms@wplus.net http://devnull.wplus.net
* There will come soft rains




pgsql-hackers by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: [PATCHES] docs done Re: [HACKERS] LIBPQ patches ...
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Index recreation in vacuum