Re: Batch update of indexes on data loading

Поиск
Список
Период
Сортировка
От Markus Bertheau
Тема Re: Batch update of indexes on data loading
Дата
Msg-id 684362e10802282040j4ac01d41j72465b940d8a6768@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Batch update of indexes on data loading  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Batch update of indexes on data loading  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2008/2/29, Tom Lane <tgl@sss.pgh.pa.us>:
> ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
>  > BTW, why REINDEX requires access exclusive lock? Read-only queries
>  > are forbidden during the operation now, but I feel they are ok
>  > because REINDEX only reads existing tuples. Can we do REINDEX
>  > holding only shared lock on the index?
>
> No.  When you commit the reindex, the old copy of the index will
>  instantaneously disappear; it will not do for someone to be actively
>  scanning that copy.

Can a shared lock be taken at first, and when the new index is ready,
in order to delete the old index, elevate that lock to an exclusive
one?

Markus

-- 
Markus Bertheau
Blog: http://www.bluetwanger.de/blog/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Silly Newbie question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Batch update of indexes on data loading