- 论坛徽章:
- 0
|
大家好!
把msyql 的全局变量log_queries_not_using_indexes设置之后,可以将没有使用索引的sql写到slow_log上面去。有一个很奇怪的问题出现了,想请教一下大家:
1、如果我开启log_queries_not_using_indexes的话,我的slow log 里面没有任何记录;
2、开启log_queries_not_using_indexes之后,slow log 里面记录了使用了索引的记录;
+----+-------------+--------------------+--------+----------------+----------+---------+------------------------------------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------------+--------+----------------+----------+---------+------------------------------------+------+-------------+
| 1 | SIMPLE | mysql_slave_status | index | NULL | time_key | 5 | NULL | 890 | |
| 1 | SIMPLE | host | eq_ref | PRIMARY,ip_key | PRIMARY | 4 | monitor.mysql_slave_status.host_id | 1 | Using where |
+----+-------------+--------------------+--------+----------------+----------+---------+------------------------------------+------+-------------+
上面就是那条语句用desc之后的结果--〉这不明明使用了索引了嘛? |
|