【问题标题】:Understanding MySQL's slow query log format了解 MySQL 的慢查询日志格式
【发布时间】:2018-12-03 07:16:44
【问题描述】:

我正在阅读 MySQL 的慢查询日志,它是:

# Time: 141004 12:30:47
# User@Host: dbuser[dbuser] @ localhost [127.0.0.1]  Id:  1959
# Query_time: 0.017325  Lock_time: 0.000112 Rows_sent: 75  Rows_examined: 22146
SET timestamp=1412413247;
SELECT ...

如果我没有在my.cnf中设置任何long_query_time,这意味着它被设置为默认值; 10 秒。我确认使用 MySQL Workbench。所以我的问题是为什么这个查询记录为慢查询?不到 2/100 秒!

顺便说一句,我在 CentOS 6.5 上使用 MySQL 5.6。

【问题讨论】:

  • my.cnf 中的log-queries-not-using-indexes 行是否未注释?

标签: mysql mysql-slow-query-log


【解决方案1】:

使用此命令检查 MySQL 日志记录查询是否运行缓慢但不使用索引:

show variables like 'log_queries_not_using_indexes'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-21
    • 2013-10-02
    • 2015-10-31
    • 2011-01-01
    相关资源
    最近更新 更多