SQL Indexing and Performance/Avoid wrapping indexed columns in functions

Preserve index usability in predicates.

Section: Index Strategy

Avoid wrapping indexed columns in functions

sql
sql
-- Less index-friendly
SELECT *
FROM users
WHERE LOWER(email) = 'a@example.com';

-- Prefer normalized storage or computed/indexed support where available
SELECT *
FROM users
WHERE email = 'a@example.com';
Explanation

Applying functions to indexed columns can prevent index usage in many engines.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Index Strategy
Index a common lookup column
Speed up frequent equality or range predicates.
OpenIn sheetsqlsame section
Use a covering index pattern
Create an index that supports filtering and ordering efficiently.
OpenIn sheetsqlsame section
Explain a query
Inspect the execution plan for a SELECT statement.
OpenIn sheetsql1 tag match
Use keyset pagination
Paginate by a stable cursor instead of a large OFFSET.
OpenIn sheetsql1 tag match
Explain with runtime stats
Run a query and collect timing or actual row information where supported.
OpenIn sheetsql1 tag match
Refresh optimizer statistics
Update table statistics for better planning.
OpenIn sheetsql1 tag match