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

From Bruce Momjian
Subject Re: [HACKERS] Index recreation in vacuum
Date
Msg-id 200001192151.QAA27235@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Index recreation in vacuum  (Dmitry Samersoff <dms@wplus.net>)
List pgsql-hackers
[Charset koi8-r unsupported, filtering to ASCII...]
> Bruce Momjian wrote:
> > 
> > We need two things:
> > 
> 
> >         auto-create index on startup
> 
> IMHO, It have to be controlled by user, because creating large index 
> can take a number of hours. Sometimes it's better to live without
> indices
> at all, and then build it by hand after workday end.

OK, full circle time.  That is why I recommended making a separate new
heap and index and using rename() to move them into place once the
vacuum is completed. In a failure during vacuum, the failed vacuum files
should be just removed on startup.  No downtime, and index is in place.

Also, I thought about how to do rename() of multiple tables atomically. 
My idea would be to have a pg_startup table that contains information
about what operations should be performed on startup.  You could write
to the file in an atomic action, and if there was a failure, on startup,
the file could be read and the operations performed.  We would basically
be using our own transaction system to guarantee file system atomicity.

--  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: Dmitry Samersoff
Date:
Subject: Re: [HACKERS] Index recreation in vacuum
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Cannot compile psql