Glossary

Index (MySQL)

An index in MySQL is a separate data structure (usually a B-Tree) that lets the database find rows without scanning the entire table. Proper indexes are the fastest way to speed up slow queries — sometimes by orders of magnitude.

When an index helps

When an index hurts

Composite indexes

An index on (a, b, c) is used left to right: a query with WHERE a = 1 AND b = 2 uses the index, but WHERE b = 2 alone does not. This is the leftmost prefix rule.