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

From Bruce Momjian
Subject Re: [HACKERS] Index recreation in vacuum
Date
Msg-id 200001181942.OAA17153@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Index recreation in vacuum  (Dmitry Samersoff <dms@wplus.net>)
Responses Re: [HACKERS] Index recreation in vacuum
List pgsql-hackers
> > 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.

The beauty of doing a temp index while keeping the old one is that you
can recover right away, and maybe allow the old index to be used while
you vacuum?

--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

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