Databases · Middle · Question 3 of 75
There's an index on created_at. Why might WHERE date(created_at) = '2026-11-01' ignore it?
- 1The
date()function is not supported in PostgreSQL - ✓Correct answer: A function on the column changes the value, so the index on the raw column can't be searched; use a range or an expression index
- 3Indexes don't work with dates
Explanation
Rewrite as created_at >= '2026-11-01' AND created_at < '2026-11-02', or create an index on the expression itself.