skip to today's puzzle

An index helps the database find rows faster

Without an index, finding order #42 means checking every row from top to bottom, called a table scan, like digging through a shoebox of receipts. An index is a separate, pre-sorted copy of one column with a pointer back to each row, like a tabbed binder. Because it is sorted, the database jumps straight to #42. Your SELECT stays exactly the same; the database just uses the index on its own.

A tiny example

In plain English: Build a sorted lookup on the orders id column so finding one order is quick.

CREATE INDEX idx_orders_id ON orders (id);

Related SQL lessons

Ready for a break?

Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.

play today's sip