All topicsTopic 14 / 24
Intermediate 1 minute
Database Indexing
An index is an additional data structure that helps a database find rows without scanning every record. Indexes can dramatically improve reads on frequently filtered or sorted columns. They are not free: they use storage and make writes slower because each change must update the index. Design indexes from real query patterns, then verify them with query plans.
Key idea
Indexes accelerate reads by spending extra storage and write work.
See it in one picture
Follow the arrowsQuery
Index
Rows
Fast lookup
A shortcut to matching rows
Real-world example
If a support dashboard often searches tickets by customer_id and created_at, a matching index can avoid scanning millions of tickets. An unused index only adds maintenance cost.
Quick check