MicrolearnENPTES

Indexes

Lesson 10 of 40 · Sys.Micro

Turn a full scan of millions of rows into a handful of page reads.

SELECT * FROM orders WHERE customer_id = 42 returns 12 rows. It takes 3 s because the table has 20 million rows.

Why a query without an index scans everything

The cost: slower writes and more storage

Check yourself

You have an index on (customer_id, created_at). Which query can NOT use it efficiently?

Do it in the browser: a real system design tool, a short mission and instant feedback. No install.

Start this lesson — free
← SQL vs. NoSQLStorage engines →

All lessons · Sys.Micro