PostgreSQL case-insensitive email lookup
Index the normalized expression you actually query.
sqlANYpostgresqlexpression-index
sql
CREATE INDEX idx_users_lower_email ON users ((lower(email)));
SELECT * FROM users WHERE lower(email) = lower('a@example.com');Notes
If the predicate calls a function, a plain index on the raw column may not help enough.