我们已经在我们的一些服务器上启用了 pt-kill,但没有杀死,现在只是为了监控慢查询。
唯一的问题是,日志不包含数据库,只包含查询。有没有办法在日志中启用查询执行的数据库?
# 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