Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Robert Treat <rob@xzilla.net>, Shayon Mukherjee <shayonj@gmail.com>, jian he <jian.universality@gmail.com>, Gurjeet Singh <gurjeet@singh.im>, Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-07-22T22:50:13Z
Lists: pgsql-hackers
On Tue, 22 Jul 2025 at 05:16, Sami Imseih <samimseih@gmail.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