5 questions to test your understanding
A table has a composite index on (country, city). A query filters only on city. How will the database handle this?
A table has 1 million rows and a 'status' column with three possible values: 'active' (60%), 'inactive' (35%), 'suspended' (5%). A developer adds an index on status to speed up queries filtering by status. What is the most likely outcome?
Adding more indexes to a frequently-written table can improve overall database performance by caching more data in memory.
A covering index can answer a query entirely from the index structure without accessing the underlying table rows.
Explain the leftmost prefix rule for composite indexes and why column order in a composite index matters enormously.