A question comes up while developing a database: "Do we really need all these indexes?"
Indexes cost some overhead to keep in sync with data. If the index is needed to optimize some queries, it's generally worth keeping the index. But if the index is not used by any query, it might be time to drop that index. But how can you be sure it's not needed?
Why not test by dropping the index and recreating it if it turns out the index is needed? Because tables get really, really large, and adding the index back could take a long time. In one case, one of the developers I supported dropped an index he thought was not needed. It turned out it was important. But adding the index back took four weeks because the table was so huge, and the server was running hard just keeping up with the other queries. In the meantime, the query that needed that index was running extremely poorly.
It would have been preferable to somehow make MySQL temporarily pretend the index does not exist, and then flip a switch and make the index visible again when they decided it was important.
https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html says:
MySQL supports invisible indexes; that is, indexes that are not used by the optimizer.
Invisible indexes make it possible to test the effect of removing an index on query performance, without making a destructive change that must be undone should the index turn out to be required. Dropping and re-adding an index can be expensive for a large table, whereas making it invisible and visible are fast, in-place operations.
An invisible index is an index that exists, and is still kept in sync with data as you run INSERT/UPDATE/DELETE statements. But the optimizer treats it as if the index is not there.
An index hint in a query can suppress use of any index, and that's the way we had to test during MySQL 5.x. But that requires finding all your SQL queries that would use the index, and changing application code. That's especially inconvenient if your queries are generated by layers of ORM code.