MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
Invisible Indexes and Descending Indexes in MySQL 8.0.
senior LevelMost AskedDatabases & SQLMySQL
In Simple Words:
- Invisible Indexes: You can toggle an index invisible to the query optimizer (
ALTER TABLE t ALTER INDEX idx INVISIBLE;) to safely test if removing it degrades performance before executing an irreversible drop. - Descending Indexes: Prior to MySQL 8.0, indexes were stored in ascending order only. Descending indexes (
CREATE INDEX idx ON orders (created_at DESC);) optimize queries sorting in reverse order without file-sort overhead.