β Backend PythonQuestion 39 of 49
Why might a query using LOWER(email) not use an index on email?
π Explanation
Using LOWER(email) applies a function to the column, so a plain index on email doesn't match; you need a functional index on LOWER(email) instead. The other explanations about reserved keywords, forced case-insensitivity, or optimizer bias against string functions are not accurate.
Related questions
- Why can having too many indexes slow down a database even though indexes improve query performance?
- What is the difference between ANALYZE and VACUUM ANALYZE in PostgreSQL?
- What index types are available in PostgreSQL and when would you use each of them?
- Why might PostgreSQL choose a sequential scan instead of using an index?
- What is the left-prefix rule for composite indexes?
β PreviousNo login needed