Practical route for function-based searches.
Section: MySQL index patterns
Index a generated column
sql
sql
ALTER TABLE users
ADD COLUMN email_lc VARCHAR(255) GENERATED ALWAYS AS (LOWER(email)) STORED,
ADD INDEX idx_users_email_lc (email_lc);Explanation
A generated column can make case-normalized lookups indexable in MySQL.
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 an invisible index
Test an index without making it visible to the optimizer by default.
Refresh table statistics
Help the optimizer make better choices after major data changes.