Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Shayon Mukherjee <shayonj(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX
Date: 2025-04-02 05:55:57
Message-ID: CABwTF4V1JCOfV=8Da037NoEJ-LGDNo=P1uwBFChBCcE5dZDguA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 22, 2024 at 3:45 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:

> I think the documents should also mention that disabling an index is a
> useful way to verify an index is not being used before dropping it as
> the index can be enabled again at the first sign that performance has
> been effected. (It might also be good to mention that checking
> pg_stat_user_indexes.idx_scan should be the first port of call when
> checking for unused indexes)

While reviewing Shayon's v14 patch, I had removed text (quoted below) from the
ALTER INDEX docs that did not feel right in a command reference. I thought
of reading up on the history/discussion of the patch, and now I see why Shayon
chose to include an advice in ALTER INDEX docs.

> + indexes. If performance degrades after making an index invisible, it can be easily
> + be made visible using <literal>VISIBLE</literal>. Before making an index invisible, it's recommended
> + to check <structname>pg_stat_user_indexes</structname>.<structfield>idx_scan</structfield>
> + to identify potentially unused indexes.

I feel ALTER INDEX command reference doc is not the right place for this kind of
operational advice. Is there a better place in documentation for this kind of
advice? Or maybe it needs to be reworded to fit the command reference style?

Best regards,
Gurjeet
http://Gurje.et

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-04-02 06:21:37 Re: Change log level for notifying hot standby is waiting non-overflowed snapshot
Previous Message Zhijie Hou (Fujitsu) 2025-04-02 05:55:37 RE: Fix slot synchronization with two_phase decoding enabled