We've enabled pt-kill on a few servers of us, but without the killing, only to monitor slow queries for now.
The only problem is, the log doesn't contain the database, only the query. Is there a way to enable in the log on what database the query is executed?
# 2012-09-12T10:31:23 KILL 419539612 (Query 138 sec) SELECT blog.*, blog_text.*, user.*
FROM blog AS blog
INNER JOIN blog_text AS blog_text ON (blog.firstblogtextid = blog_text.blogtextid)
INNER JOIN blog_user AS blog_user ON (blog_user.bloguserid = blog.userid)
LEFT JOIN user AS user ON (user.userid = blog_text.userid)
WHERE 1=1
AND blog.state = 'visible'
AND blog.dateline <= 1347438544
AND blog.pending = 0
AND blog_user.options_guest & 1
AND ~blog.options & 8
ORDER BY blog.dateline DESC
LIMIT 15
Logging the database for the query is not currently a feature of pt-kill (as of version 2.1.x).
This feature has been requested in the past:
https://bugs.launchpad.net/percona-toolkit/+bug/1015804
But it has not been implemented yet.