MySQL Index Strategies and Verification/Create an invisible index

Test an index without making it visible to the optimizer by default.

Section: MySQL index patterns

Create an invisible index

sql
sql
CREATE INDEX idx_orders_coupon_code ON orders (coupon_code) INVISIBLE;
Explanation

Invisible indexes are useful for experiments and staged rollouts.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing MySQL index patterns
Create a composite index
Support a filter plus order-by pattern.
OpenIn sheetsqlsame section
Index a generated column
Practical route for function-based searches.
OpenIn sheetsqlsame section
Toggle index visibility
Hide or re-enable an index without dropping it.
OpenIn sheetsqlsame section
Explain a query
See whether the optimizer chooses your index.
OpenIn sheetsql1 tag match
Refresh table statistics
Help the optimizer make better choices after major data changes.
OpenIn sheetsql1 tag match
Test with FORCE INDEX
Diagnostic tool for checking alternate index paths.
OpenIn sheetsql1 tag match