Adding exclusion constraint in a big table

Поиск
Список
Период
Сортировка
От Marcelo Fernandes
Тема Adding exclusion constraint in a big table
Дата
Msg-id CAM2F1VNeP1itvrO0rDrwJJU5Us8X4EE-jPQ2yYA7NjygeXq3ZA@mail.gmail.com
обсуждение исходный текст
Список pgsql-performance
Hi folks,

I need to add an exclusion constraint in a large table.

However, I'm worried about the length of time the table will be
blocked for reads and writes while the constraint is being
created.

With other operations, like adding unique indexes, I can create the
index first, concurrently, and then use that existing index to create
the constraint in place. This approach works well for large tables.

But this doesn't look like something I can do with exclusion
constraints, as I can't perform an ALTER TABLE ... USING INDEX ...

It also does not seem like I can add the constraint with a NOT VALID
condition either.

Do you folks have any recommendations for this situation?

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