> IMO, having this GUC to force the use of invisible indexes is quite > strange. In my view, it detracts from the guarantees that you're meant > to get from disabling indexes. What if some connection has > use_invisible_index set to true? The DBA might assume all is well > after having seen nobody complain and then drop the index. The user > might then complain. >
Sure, this may occur. I can also imagine cases where an index is made visible only for certain workloads, intentionally. But such efforts should be coordinated by application teams and DBAs. Someone would need to modify this GUC at the connection level, alter the database, or change the session via application code. An ad-hoc connection enabling this GUC is unlikely to be an issue. I don't see how we could provide the INVISIBLE index DDL without also providing this boolean GUC. If a user creates an index that is initially INVISIBLE, they need a GUC to try it out before deciding to make it visible. It was also pointed out in the thread above that this GUC can serve as a backstop for replicas if the DDL to make an index visible is delayed. -- Sami