Questions: Index Design and Selection Strategy

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A table has a composite index on (country, city). A query filters only on city. How will the database handle this?

AIt will use the composite index efficiently, since city is one of the indexed columns
BIt will use only the city portion of the composite index, skipping the country portion
CIt will likely not use the composite index, since the leftmost prefix (country) is not in the query
DIt will use the index but only if the city column has high selectivity
Question 2 Multiple Choice

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?

AThe index will dramatically speed up all queries filtering by status
BThe index will be most useful for status = 'suspended' queries but may not help for 'active' or 'inactive'
CThe index will slow down reads because the database must scan the entire index before the table
DThe index will have no effect because it was added after the table was populated
Question 3 True / False

Adding more indexes to a frequently-written table can improve overall database performance by caching more data in memory.

TTrue
FFalse
Question 4 True / False

A covering index can answer a query entirely from the index structure without accessing the underlying table rows.

TTrue
FFalse
Question 5 Short Answer

Explain the leftmost prefix rule for composite indexes and why column order in a composite index matters enormously.

Think about your answer, then reveal below.