2012-09-12 40 views
2

我們已經在我們的幾臺服務器上啓用了pt-kill,但沒有進行查殺,只是爲了現在監控緩慢的查詢。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 

回答

1

它由vBulletin運行,如果有幫助。通過索引「blog」和「blog_user」表中的一些引用字段,您可以大幅加快查詢速度。