Loading…
An index is like a book's index - it helps find data without scanning every row.
Common indexed columns:
✅ Good for indexes:
WHERE user_id = 5 -- exact match
WHERE status = 'active' -- equality
WHERE created_at > '2026-01-01' -- range on indexed column
❌ Often prevents index use:
WHERE LOWER(email) = '...' -- function on column
WHERE status != 'deleted' -- NOT equal (sometimes)
WHERE description LIKE '%word%' -- wildcard at start
Write an efficient query to find all events for a specific user (user_id = 3):
Downloading SQL engine… (one-time)
This runs entirely in your browser and is cached for next time.