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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Shayon Mukherjee <shayonj(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Gurjeet Singh <gurjeet(at)singh(dot)im>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX
Date: 2025-07-22 22:50:13
Message-ID: CAApHDvo2nJDMN-ndCM9E9eP5PC73UeBXO7KRj_aO8eiebre-VQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 22 Jul 2025 at 05:16, Sami Imseih <samimseih(at)gmail(dot)com> wrote:
> Also, I'd like to ask. what would be the argument against offering both options,
> ALTER and a GUC to override the catalog, as currently proposed in the patch?

For me, the reason I don't like ALTER TABLE + the use_invisible_index
/ force_invisible_index (the v18 patch seems to be confused about the
name of that GUC) is because it puts into question what "invisible"
means. It's going to be a pretty useless feature for use cases where a
DBA wants to ensure a certain index is *never* used, but does not want
to drop it. A DBA might want to disable a certain index to investigate
certain forms of index corruption and it might not be good if people
can just overwrite that to bypass the DBA's choice.

It might be a slightly more flexible feature if there were 3 possible
states and one of those states could be clearly defined to mean that
users can overwrite the disabledness of all indexes by setting a GUC.
I'm still struggling to like that, however.

Now wondering if it would be better to spend the effort looking at
pg_hint_plan and seeing how hard it would be to get global hints added
which are applied to all queries, and then add a way to disable use of
a named index. (I don't have any experience with that extension other
than looking at the documentation)

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-07-22 22:53:52 Re: index prefetching
Previous Message Michael Paquier 2025-07-22 22:46:30 Re: redis_fdw failure on crake