Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch) - Mailing list pgsql-hackers

From Michail Nikolaev
Subject Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)
Date
Msg-id CANtu0oiBRqFoNSjCxeP+JcvXXGW-EQjw-Kkr8nibWace9hcZ4w@mail.gmail.com
Whole thread Raw
In response to Proposal to Enable/Disable Index using ALTER INDEX  (Shayon Mukherjee <shayonj@gmail.com>)
List 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 by date:

Previous
From: Greg Sabino Mullane
Date:
Subject: Re: psql: Option to use expanded mode for various meta-commands
Next
From: Bruce Momjian
Date:
Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information