A standard index adds a data structure that helps a database find rows by column values and avoid repeatedly sorting an entire table. B-trees commonly maintain indexed values in sorted order. section 7.9
Speeding up a movie listing
Suppose users usually want the highest-rated movies. Sorting millions of rows before returning 30 results can be expensive. Add an index to the rating column, then keep the query: SELECT * FROM movie ORDER BY rating DESC LIMIT 30;. The same index can support an exact-value lookup such as WHERE rating = 5. section 7.9
