Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

Поиск
Список
Период
Сортировка
От Michail Nikolaev
Тема Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)
Дата
Msg-id CANtu0oiBRqFoNSjCxeP+JcvXXGW-EQjw-Kkr8nibWace9hcZ4w@mail.gmail.com
обсуждение исходный текст
Ответ на Proposal to Enable/Disable Index using ALTER INDEX  (Shayon Mukherjee <shayonj@gmail.com>)
Список pgsql-hackers
Hello.

A few comments on patch:

> + temporarily reducing the overhead of index maintenance
> +      during bulk data loading operations

But tuples are still inserted, where the difference come from?

> or verifying an index is not being used
> +      before dropping it

Hm, it does not provide the guarantee - index may also be used as an arbiter for INSERT ON CONFLICT, for example. For that case, "update pg_index set indisvalid = false" should be used before the DROP, probably.
Also index may also be used for constraint, part of partitioned table, etc.

Also, I think it is better to move check to indisvalid as if (!index->indisvalid || !index->indisenabled).

Best regards,
Mikhail.

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