EasyEnv
MySQL
IntermediateLesson 8 of 1330 min · hands-on

Indexes

Part of the MySQL course

The login endpoint worked fine with two hundred test users. In production, with four million, WHERE email = '[email protected]' takes eight seconds, and nothing about the query changed. That is the whole story of this lesson: without help, MySQL answers that question by reading every single row and comparing each one.

An index is a separate, sorted structure the database keeps beside your table so it can jump straight to the rows you asked for. It is the index at the back of a book: instead of turning pages until you find the word, you look it up alphabetically and go directly to the page. That analogy also carries the cost, which is the half people forget. ...

Want to learn MySQL Indexes in a real environment?

Click below, get a fresh Linux box with MySQL ready to go, and work through Indexes hands-on with an AI tutor that knows your code.

Start this lessonIndexes

What you'll learn

  • B-tree index
  • CREATE INDEX
  • Multi-column index left-prefix rule
  • UNIQUE index
  • FULLTEXT index
  • Indexes hurt write performance

Read this lesson in your language

All lessons in this course

13 lessons
  1. 1What is MySQL20 min
  2. 2The mysql CLI and First Commands25 min
  3. 3Creating Databases and Tables30 min
  4. 4Data Types30 min
  5. 5SELECT and WHERE30 min
  6. 6Joins35 min
  7. 7Aggregates and Grouping30 min
  8. 8Indexes30 min
  9. 9Transactions and Storage Engines35 min
  10. 10Stored Procedures and Triggers35 min
  11. 11EXPLAIN and Query Tuning35 min
  12. 12mysqldump and Restore25 min
  13. 13Capstone: Design an Ecommerce Schema50 min

Explore other courses

Indexes - MySQL (English) | Engineering Courses