MYSQL为什么long_query_time设置了1秒,slow log中记录了小于1秒的慢查询

可能原因有两种:
1.打开了log_queries_not_using_indexes选项,记录了未走索引的SQL

"(root@localhost) 11:17:  [(none)]>show variables like '%log_queries_not_using_indexes%';
+-------------------------------+-------+
| Variable_name                 | Value |
+-------------------------------+-------+
| log_queries_not_using_indexes | ON    |
+-------------------------------+-------+
1 row in set (0.00 sec)

2.设置了全局的long_query_time未对当前连接生效

你可能感兴趣的:(mysql,慢日志)