DSA Factory
Free Indexes, queries and scale lessonsIndexes, queries and scale · Stage 1 · Indexes · Step 2

Composite, covering and selective indexes

Pick an index for a real query: the order of columns, whether it can cover the query, and whether it will be used at all. About 14 minutes.

Quick check

You have an index on (last_name, first_name). Which query can NOT use it to seek?

  1. AWHERE first_name = 'Priya'
  2. BWHERE last_name = 'Rao'
  3. CWHERE last_name = 'Rao' AND first_name = 'Priya'
Show the answer

WHERE first_name = 'Priya'. It skips the leading column: the first names are scattered through the index.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve