Blog
Write-ups of problems I ran into: cause, fix, how I verified it, and what I learned.
Why adding an index made my GROUP BY slower (SQLite)
An index on a foreign-key column made a point lookup 17× faster and a per-movie average with JOIN + GROUP BY slower. Query plans and a five-variant experiment provided evidence for the likely cause, and a covering index substantially improved this query.