speeding up ALTER ... SET NOT NULL

Поиск
Список
Период
Сортировка
От Ben Chobot
Тема speeding up ALTER ... SET NOT NULL
Дата
Msg-id A09673DF-D000-49CC-A888-5C01360C54CF@silentmedia.com
обсуждение исходный текст
Список pgsql-general
I'm in an unfortunate position of needing to add a unique, not null index to a very large table with heavy churn.
Withouthaving much impact, I can add a NULL column that reads default values from a sequence for new rows, and then do
batchupdates over time to fill in the old values.... but then I hit a big wall of locking when updating that column to
beNOT NULL.  

If I were to make a partial index on my new, sequence-feed column where value is null (concurrently, of course), is
postgressmart enough to use that index when checking existing values for the ALTER command? Or even any index (I'll
haveto make a unique one eventually anyway). 

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

Предыдущее
От: Jerry Sievers
Дата:
Сообщение: Re: restoring to different architecture with WAL
Следующее
От: Ben Chobot
Дата:
Сообщение: Re: Splitting Postgres into Separate Clusters?