Problem Statement
For a composite index on (country_code, email), which predicate can fully seek the index?
Explanation
Composite indexes are left-prefix. To fully seek, you must filter on the leading column(s). Filtering only on the second column often needs a scan.
Plan index column order by your most common predicates and how they combine.
Code Solution
SolutionRead Only
CREATE INDEX idx_users_cc_email ON users(country_code, email);
Practice Sets
This question appears in the following practice sets:
