Indexes & Performance · SQL SQL

What is a partial index, and when is it most advantageous to use one?

Practice question from Indexes & Performance (SQL SQL), with the correct answer and a step-by-step solution.

hard · MCQ · Q-848CE1

What is a partial index, and when is it most advantageous to use one?

  1. A.An index built on only a subset of table rows defined by a WHERE clause, saving storage and maintenance overhead for unindexed rows.Correct answer
  2. B.An index that only indexes the first 10 characters of a text column to save RAM.
  3. C.An index that is temporarily disabled during bulk inserts and re-enabled afterward.
  4. D.An index created automatically on tables with fewer than 1,000 rows.

Solution

A partial index includes a predicate (e.g., CREATE INDEX idx_active ON users(email) WHERE status = 'active'). It is beneficial when queries target a specific subset of data, drastically reducing index size and write overhead.

More from Indexes & Performance

All of Indexes & Performance

Practise more SQL

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed