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);
Discussion 0
Join free to post in the discussion.
Related questions
- Stopping SQL injectionBackend Developer
- Purpose of a database indexBackend Developer
- Rows returned by a LEFT JOINBackend Developer
- What a foreign key enforcesBackend Developer
- Atomicity in a money transferBackend Developer
- COUNT and AVG with NULLsBackend Developer
- Filtering grouped resultsBackend Developer
- Slow email during signupBackend Developer