Why might an index not be used?

SQL indexes, transactions and performance · Freshers and experienced

Model answer

Common reasons: the function is applied to the column (WHERE LOWER(email) = ...), a leading wildcard in LIKE '%abc', a type mismatch causing a cast, low selectivity (the planner prefers scanning), stale statistics, or the table is small. Fix the query or create an index that matches it (such as an expression index).

Learn this topic

Indexes and Faster Queries: EXPLAIN for Beginners in the course SQL for Beginners: Learn Databases Step by Step.

Sign in to add your own answer.

More questions