MicrolearnENPTES

Indexes and query plans

Lesson 24 of 24 · SQL.Micro

An index is a sorted lookup structure, like the index of a book. It makes searches on a column fast at the cost of some space and slower writes.

Index the columns you filter and join on most.

EXPLAIN QUERY PLAN SELECT … shows whether an index is used.

Check yourself

What is the cost of adding an index?

Create an index named idx_orders_customer on orders(customer_id).

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

Start this lesson — free
← UPDATE and DELETE

All lessons · SQL.Micro