Indexes

An index is the book’s table of contents. Use it.

▶ the lesson · ~35s · narrated · tap for sound

the intro

An index is a sorted lookup structure that lets the database find rows without scanning the whole table. Queries on indexed columns go from seconds to milliseconds. The trade: indexes make reads fast and writes slightly slower, so index what you query, not everything.

fun fact ✦

A missing index on one column can be the difference between 4ms and 4 seconds. Same query, same data.

the docs

quick hits about Indexes

15-second answers · interviews, tips, trivia & hidden gems

🎤 interview

What is an index?

📚 tutorial

When does an index hurt?

🔧 useful

Column order matters

💎 deep

Index only the rows you query

💎 deep

Read EXPLAIN like a pro