Skip to content
RED SAGSkills
medium10 pts · first answer countssqlindexingperformance

Index ignored for lower(email)

The users table has a B-tree index on email, but this query does a sequential scan on 5 million rows. What is the best fix in PostgreSQL?

SELECT id FROM users WHERE lower(email) = lower($1);
Choose one answer