mysql慢查询的奇异事件

打开mysql慢查询日志,发现有很多sql查询时间很短,明显不到0.01s的sql竟然也在慢日志查询里面,日志详细情况如下:
# User@Host: otterpro[otterpro] @  [172.22.53.122]  Id:  2061
# Schema: otter  Last_errno: 0  Killed: 0
# Query_time: 0.000559  Lock_time: 0.000080  Rows_sent: 3  Rows_examined: 327  Rows_affected: 0
# Bytes_sent: 755
SET timestamp=1512715920;
select   ID,NODE_ID,PIPELINE_ID,LOCATION,GMT_CREATE,GMT_MODIFIED     from PIPELINE_NODE_RELATION where NODE_ID = 74 ORDER BY ID DESC;
# Time: 171208 14:52:08
# User@Host: otterpro[otterpro] @  [172.22.53.122]  Id:  2061
# Schema: otter  Last_errno: 0  Killed: 0
# Query_time: 0.000214  Lock_time: 0.000110  Rows_sent: 2  Rows_examined: 2  Rows_affected: 0
# Bytes_sent: 821
SET timestamp=1512715928;
select   ID,CLUSTER_NAME,SERVER_LIST,DESCRIPTION,GMT_CREATE,GMT_MODIFIED   from AUTOKEEPER_CLUSTER    ORDER BY ID ASC;

有点怀疑再次查看了参数:

mysql>  show global status like '%slow_queries%';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Slow_queries  | 6055683 |
+---------------+---------+

mysql> show variables like '%slow_query_log%';
+------------------------------------+--------------------------------+
| Variable_name                      | Value                          |
+------------------------------------+--------------------------------+
| slow_query_log                     | ON                             |
| slow_query_log_always_write_time   | 10.000000                      |
| slow_query_log_file                | /data/mysql/13306/tmp/slow.log |
| slow_query_log_timestamp_always    | OFF                            |
| slow_query_log_timestamp_precision | second                         |
| slow_query_log_use_global_control  |                                |
+------------------------------------+--------------------------------+
6 rows in set (0.01 sec)
mysql> show variables like 'long_query_time';
+-----------------+----------+
| Variable_name   | Value    |
+-----------------+----------+
| long_query_time | 0.100000 |
+-----------------+----------+
1 row in set (0.00 sec)

mysql> show global variables like '%general%'; 
+------------------+--------------------------------+
| Variable_name    | Value                          |
+------------------+--------------------------------+
| general_log      | OFF                            |
| general_log_file | /data/mysql/13306/tmp/file.sql |
+------------------+--------------------------------+
2 rows in set (0.00 sec)



log-queries-not-using-indexes


如果运行的SQL语句没有使用索引,则mysql数据库同样会将这条SQL语句记录到慢查询日志文件中。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28686045/viewspace-2148532/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28686045/viewspace-2148532/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值