21 lines586 B

Lesson 8: Indexes and why queries get slow

Indexes and why queries get slow comes up in almost every real SQL project. We start with the why, then write code together.

Full lesson: https://glibcode.net/courses/sql-essentials/lessons/8

Files

  • indexes.sql: EXPLAIN QUERY PLAN before and after an index

Run it

sqlite3 shop.db < ../../setup/schema.sql
sqlite3 shop.db < ../../setup/seed.sql
sqlite3 shop.db < indexes.sql

Exercises

See exercises.md. Ask in the forum once you've tried.