【问题标题】:Why do I have so many extension tables in my slow query log?为什么我的慢查询日志中有这么多扩展表?
【发布时间】:2012-05-30 19:23:28
【问题描述】:

我想优化我的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;

【问题讨论】:

    标签: mysql typo3 mysql-slow-query-log


    【解决方案1】:

    很久以前就有人建议不时裁剪您的sys_log 表格(即离开过去 30 天),以预览最近用户的活动。

    编辑:Jochen Weiland 的 well known presentation 关于 oil changing - 典型的 must-read 位置

    【讨论】:

      【解决方案2】:

      您可以随时刷新参考索引,这样如果您无法清除 sys_log,它会更快 顺便说一句,如果您想记录长查询,请将时间参数设置为 2 秒或类似的东西

      【讨论】:

        猜你喜欢
        • 2012-06-01
        • 2012-07-27
        • 2011-03-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-11
        • 2015-09-20
        • 1970-01-01
        相关资源
        最近更新 更多