Tuning gym
A slow query and a schema you may add indexes to. Scored on what you won against what it cost every write — an index is not free, and six of them is not a solution.
One actor's slowest events
This report is run constantly and it reads most of the table every time. Add whatever indexes you think are worth having, and see what they cost.
SELECT id, kind, duration_ms FROM events WHERE actor_id = 137 AND duration_ms > 2000 ORDER BY duration_ms DESC
There are already indexes on `actor_id` and on `(kind, happened_on)`. Every index you add is maintained by every insert, update and delete on this table, forever.
Your schema changes
⌘⏎