Recall & Review
beginner
What is the main purpose of using indexes in a database?
Indexes help the database find data faster, like a shortcut in a book's table of contents.
Click to reveal answer
beginner
Which type of queries benefit most from indexes?
Queries that search for specific values or ranges, such as SELECT with WHERE clauses, benefit most from indexes.
Click to reveal answer
intermediate
Why should you avoid indexing every column in a table?
Because indexes take extra space and slow down data changes like INSERT, UPDATE, and DELETE.
Click to reveal answer
intermediate
What is a composite index?
An index that includes multiple columns to speed up queries filtering by those columns together.
Click to reveal answer
advanced
How does MySQL choose which index to use for a query?
MySQL uses the query optimizer to pick the index that will return results fastest based on statistics and query conditions.
Click to reveal answer
Which of these is NOT a good reason to create an index?
✗ Incorrect
Indexes slow down INSERT operations because the index must be updated with new data.
What does a composite index contain?
✗ Incorrect
A composite index includes multiple columns to optimize queries filtering by those columns together.
When should you consider adding an index to a column?
✗ Incorrect
Indexes help most when columns are frequently used to filter data in WHERE clauses.
What is a downside of having too many indexes?
✗ Incorrect
Too many indexes use more disk space and slow down data changes like INSERT, UPDATE, and DELETE.
How does MySQL decide which index to use?
✗ Incorrect
MySQL's query optimizer chooses the best index based on data statistics and query conditions.
Explain how to decide which columns to index in a MySQL table.
Think about which columns help find data quickly and which slow down updates.
You got /4 concepts.
Describe the trade-offs involved in adding indexes to a database table.
Indexes are like shortcuts but cost extra to maintain.
You got /4 concepts.