Re: Should I implement DROP INDEX CONCURRENTLY?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Should I implement DROP INDEX CONCURRENTLY?
Дата
Msg-id CA+TgmoYvGjaARPofXTWC+OBVF13Nib2MLVcc7940w-91ZuQGtg@mail.gmail.com
обсуждение исходный текст
Ответ на Should I implement DROP INDEX CONCURRENTLY?  (Daniel Farina <daniel@heroku.com>)
Список pgsql-hackers
On Wed, Aug 24, 2011 at 2:24 PM, Daniel Farina <daniel@heroku.com> wrote:
> Could I make the ACCESS EXCLUSIVE section just long enough to commit
> catalog updates, and then have the bulk of the work happen afterwards?
>
> The general idea is:
>
> 1) set an index as "invalid", to ensure no backend will use it in planning
> 2) wait for the xmin horizon to advance to ensure no open snapshots
> that may not see the invalidation of the index are gone (is there a
> way to tighten that up? although even this conservative version would
> be 80-90% of the value for us...)
> 3) then use performDeletions without taking a lock on the parent
> table, similar to what's in tablecmds.c already.
>
> A DROP INDEX CONCURRENTLY may leave an invalid index if aborted
> instead of waiting for statement confirmation, just like CREATE INDEX
> CONCURRENTLY.

This might be a dumb idea, but could we rearrange CommitTransaction()
so that smgrDoPendingDeletes() happens just a bit further down, after
those ResourceOwnerRelease() calls?  It seems like that might
accomplish what you're trying to do here without needing a new
command.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "make -j4 world" falls over
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Should I implement DROP INDEX CONCURRENTLY?