pt-query-digest ranks by total time, not by slowest

The slow log ranks by individual duration, so a query taking two seconds once appears above one taking forty milliseconds two hundred thousand times.

$ pt-query-digest /var/log/mysql/slow.log | head -20

# Rank Response time  Calls   R/Call  Item
#    1 812.4s  41.2%  201441  0.0040  SELECT order_lines
#    2 402.1s  20.4%       3  134.03  SELECT reports

$ SET GLOBAL long_query_time = 0.05;   # during an investigation only

Ranking by total time is the whole point, and it groups by normalised query so the same statement with different literals is one row. Lowering the threshold to fifty milliseconds is what makes the log useful — the default of ten seconds logs almost nothing on a healthy system. Turning it back up afterwards matters, because the log is a write on every slow query and it is easy to leave on.