Ram
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 arrows

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

Can you spot it?

0/2 answered
Question 1

1. What does an index optimize?

Question 2

2. What is an index cost?