0
0
MySQLquery~5 mins

Index selection strategy in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AImproving INSERT performance
BHelping with JOIN operations
CSpeeding up SELECT queries
DFiltering rows faster in WHERE clauses
What does a composite index contain?
AMultiple columns
BOnly foreign keys
COnly primary keys
DOne column only
When should you consider adding an index to a column?
AWhen the column is rarely used in queries
BWhen the column stores large text blobs
CWhen the column is often used in WHERE clauses
DWhen the column is only used for sorting
What is a downside of having too many indexes?
AQueries run faster
BMore disk space is used
CData updates become slower
DBoth B and C
How does MySQL decide which index to use?
AUses the first created index
BUses the query optimizer based on statistics
CRandomly picks one
DAlways uses the primary key index
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.