Indexing basics
45 min · Intermediate
An index is a separate, sorted data structure that lets the database find rows by a column's value without reading the whole table, like the index at the back of a textbook that sends you straight to page 214. Section 12's Indexes & Query Performance module covers creating and reading indexes in MySQL; this lesson revises the theory interviewers ask.
Topics in this lesson
- Why indexes speed up reads and slow down writes
- Clustered vs non-clustered indexes
- B-tree and B+ tree at interview level
- When an index is not used
- Interview questions with model answers
Interview questions this lesson answers
- What is an index in a database?
- Why not create an index on every column?
- Which operations does an index speed up?
- What is a full table scan?
- What is a clustered index?
- What is a non-clustered index?
- What is the difference between clustered and non-clustered indexes?
- What happens in InnoDB if a table has no primary key?
- Why should an InnoDB primary key be short?
- What is a covering index?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.