
The query that taught me about indexes
A page in my project took four seconds to load with 12,000 rows. I assumed the framework was slow.
It was a sequential scan on a column I filtered by on every request. One index took it to 30 milliseconds.
What I actually learned was the habit: read the query plan before guessing. EXPLAIN ANALYZE told me in ten seconds what I had spent an evening assuming.