
How Database Indexes Work
How an index turns a slow full table scan into a fast lookup
What you'll learn
- What a full table scan is, and why it gets slow
- What an index is, and how a B-Tree finds a row fast
- What indexes cost on writes and disk
- Which columns to index, and checking with EXPLAIN
In this video, we'll look at why a query that was fast with 1,000 rows can take seconds with 10 million, and how database indexes fix it. We'll cover full table scans, B-Tree indexes, how indexes speed up lookups, and why adding too many indexes slows down writes.
We'll also look at how to create an index, which columns to index, and how to use EXPLAIN to see whether your database used an index or scanned the whole table.



