2012-05-30 19 views
0

我想优化我的mysql数据库,从而启用my.cnf中的mysql慢查询开关。我所看到的是许多sys_log查询,包括来自我的扩展或其他许多表的查询。这是一个缓慢的查询?我怎么能够胜过它?为什么我的慢查询日志中有这么多扩展表?

# Query_time: 0 Lock_time: 0 Rows_sent: 538 Rows_examined: 23611 
SELECT sys_log.event_pid, sys_log.recuid, sys_log.tablename, sys_log.userid,  
sys_log.tstamp, be_users.realName, be_users.email FROM sys_log, be_users WHERE 
sys_log.tablename IN 
('tx_templavoila_datastructure','tx_templavoila_tmplobj','tx_chsystemrecherche_mo','tx_chsystemrecherche_s2','tx_chsystemrecherche_s3','tx_chsystemrecherche_s1','tx_chsystemreche che_da','tx_chsystemrecherche_de','tx_chsystemrecherche_wa','tx_chsystemrecherche_tb','tx_chsffoeag_fund','tx_charbeitsbeispiele_maxmedia','tx_chsammelstellen_plz','tx_chtreeview_example','tx_chspeditionsliste_route','tx_chspeditionsliste_k','tx_chhaendlersuche_plz','tx_veguestbook_entries','tx_lastupdate_custom','tt_content') AND sys_log.details_nr != 0 AND sys_log.userid = be_users.uid ORDER BY tstamp DESC LIMIT 0,1000; 

回答

0

有人建议很久以前从时间裁剪您sys_log表时间(即离开过去30天),以确保近期用户活动的预览。

编辑:有由Jochen韦兰德是well known presentationoil changing - 典型must-read位置

0

可以随时刷新参考指标,所以如果你不能老是明确sys_log 顺便说一句,如果你想登录长查询设定的时间PARAM它会更快2秒或类似的东西