Postgresql: very slow results with "group by"
In my hands this query, on a simulated data set, is ten times faster than you observed, even on pretty crummy hardware. It has the same EXPLAIN plan and similar estimated costs, just much faster execution.  So either something very strange is going on, or your server is seriously overloaded.  Your best bet for investigating that might be outside of PostgreSQL, for example using top, perf, vmstat, etc.

As far as an index, the one best suited for this query would be:

create index on reports (run_id , detection_status, bug_id);


This allows it to use an index only scan to complete the query, and in my hands is 4 to 5 times faster.  But I don't know how that would translate to your server, as it seems to have an undiagnosed performance pathology.  Also, you need to keep reports well vacuumed for this to be effective, otherwise the index-only nature of the scan loses its benefit.  You might need to modify the tables autovac parameters to get it to be vacuumed enough, or set up your own manual vacuum scripts.