Database Management
MySQL
Subjective
Oct 01, 2025
What is an INDEX in MySQL and why is it important?
Detailed Explanation
An INDEX is a data structure that improves query performance by creating shortcuts to data.
Benefits:
• Faster SELECT queries
• Faster WHERE, ORDER BY, GROUP BY
• Unique constraints
Types:
• PRIMARY (unique, not null)
• UNIQUE (unique values)
• INDEX (regular index)
• FULLTEXT (text searching)
Example:
CREATE INDEX idx_email ON users(email);
CREATE UNIQUE INDEX idx_username ON users(username);
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts