3 ms·
WHERE lower(email) = lower('foo@example.com') Is simple and hits an index on lower(email). I'm not sure ILIKE can hit an index in your example.
by always_good 9y ago
WHERE lower(email) = lower('foo@example.com')
Is simple and hits an index on lower(email).
I'm not sure ILIKE can hit an index in your example.
- olavgg 9y agoIt can if you use the pg_trgm extension, a good summary can be read here: https://niallburkley.com/blog/index-columns-for-like-in-postgres/ https://niallburkley.com/blog/index-columns-for-like-in-post...