Databases · Middle · Question 5 of 75
What is a partial index?
CREATE INDEX ON orders (created_at) WHERE status = 'pending';- 1An index that covers only part of each value
- ✓Correct answer: An index on only the rows matching a condition, which makes it smaller and cheaper to maintain
- 3An index that is built in the background
Explanation
It's great when queries always filter on a rare value. A partial unique index can also enforce rules like 'one active subscription per user'.