The short answer
An index is a data structure that helps the database find rows faster without scanning the entire table.
Imagine:
Book → index → page
Instead of reading every page, you look in the index.
Example:
CREATE INDEX idx_customer_email
ON customers(email);Now searches on email may be faster.
Downsides
- Extra storage
- Slower INSERT/UPDATE/DELETE
- Maintenance overhead
- Too many indexes can hurt write performance