One index, 64× faster: what a composite index actually does
A query summing one customer's payments took 1,086 ms. After adding one index, the same query took 17 ms.
The query didn't change. What changed was how MySQL could find the rows. Here's what happened