online reindex - Mailing list pgsql-hackers

From Greg Stark
Subject online reindex
Date
Msg-id 87lm0ggtif.fsf@stark.dyndns.tv
Whole thread Raw
Responses Re: online reindex
List pgsql-hackers
It sounds to me like it should be fairly straightforward to implement online
reindex. That is, reindex without locking the table. This is an important
feature for 24x7 operation. Since postgres doesn't modify data in place the
only thing required for online reindex is to ensure that the reindex operation
sees all of the latest data.

If reindex sets a flag that causes all new inserts and updates to allocate new
space at the end of the heap without checking for free space, then a simple
linear scan should be guaranteed to catch all the data.

(I'm not sure how the indexing operation works, if it reads in the whole table
and then sorts it there would have to be an extra step where any new tuples
are read in and inserted.)

There would only have to be a small window with the table locked while the
indexes are swapped at the end.

-- 
greg



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: location of the configuration files
Next
From: Patrick Welche
Date:
Subject: Re: psql and readline