Think of a composite index as a phone book. The phone book is sorted by last name and then by first name. If you are given the name Bob Smith, you can quickly find section S, then Sm, then all Smith, and then Bob. This is fast because you have both keys in the index. Since the book is organized by first name, it would also be trivial to find all of Smith's notes.
Now imagine that you are trying to find all the people named Bob in the entire phone book. Much harder, right?
This is similar to how an index on a disk is also organized. Searching for all rows with a specific page column, when the list sorted in order (name, page) will basically lead to a sequential check of all rows, looking one after another at everything that has this page.
For more information on how indexes work, I recommend reading Use Index, Luke .
source share