InnoDB indexes are B+trees: balanced trees where every leaf sits at the same depth and leaves are linked for fast range scans. A lookup is O(log n) — a handful of page reads even on huge tables.
Composite indexes and the leftmost prefix
A composite index sorts rows by , then , then . You can use it only for a of the columns: , , or — but alone or , because those columns aren't sorted until is fixed.
