mysql 快速查询变更记录_MySQL慢查询日志记录快速查询

bd96500e110b49cbb3cd949968f18be7.png

I'm having an issue where MySQL seems to be logging queries in the slow query log that are faster than the time specified. I've configured MySQL to log the following:

Server version: 5.1.54-1ubuntu4-log

+---------------------+-------------------------------+

| Variable_name | Value |

+---------------------+-------------------------------+

| log_slow_queries | ON |

| long_query_time | 2.000000 |

| slow_query_log | ON |

| slow_query_log_file | /var/log/mysql/mysql-slow.log |

+---------------------+-------------------------------+

4 rows in set (0.00 sec)

However, in my slow query log I can see that it's logging sub-second queries:

# Time: 121116 17:09:00

# User@Host: user[user] @ ip-10-x-x-x.ec2.internal [x.x.x.x]

# Query_time: 0.007098 Lock_time: 0.000075 Rows_sent: 50 Rows_examined: 2693

I've set the above variable dynamically using 'SET GLOBAL ...', but even before that the long_query_time was set to 1.000000 seconds.

Any idea why MySQL could be logging queries that are faster then what is specified?

解决方案

According to the documentation, there's another option that could cause queries to get logged in the slow query log:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值