1-- users.email has a B-tree index
2SELECT id, name
3FROM users
4WHERE LOWER(email) = 'alice@example.com';
5-- EXPLAIN shows Seq Scan instead of Index Scan
6-- Table has 2 million rows, query takes 4 seconds
no lines flagged
#021PracticeMedium15 min · 120 XP
Function on Indexed Column Prevents Index Scan
A query that should use an index runs a full table scan instead. Find the line that defeats the index.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.