如何“设置时间戳"?是一个缓慢的查询? [英] How can "set timestamp" be a slow query?
问题描述
我的慢速查询日志中充满了如下所示的条目:
My slow query log is full of entries like the following:
# Query_time: 1.016361 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
SET timestamp=1273826821;
COMMIT;
我猜set timestamp
命令是通过复制发出的,但是我不明白set timestamp
如何占用一秒钟的时间.关于如何解决此问题的任何想法?
I guess the set timestamp
command is issued by replication but I don't understand how set timestamp
can take over a second. Any ideas of how to fix this?
推荐答案
Timestamp
是MySQL中的数据类型和内置函数.您想通过以下语句达到什么目的?
Timestamp
is a data type and a built-in function in MySQL. What are you trying to achive with the following statement?
SET timestamp=1273826821;
UPD :很抱歉,我不知道所使用的MySQL hacks.
UPD: I am sorry, I didn't know about the used MySQL hacks.
似乎SET TIMESTAMP
用作解决方案,从慢速日志中排除一些查询.
OP正在使用 Microslow修补程序在慢速查询日志中增强统计信息,并且该语句在InnoDB表上的语句之前是常见的.
The OP is using the Microslow patch to enhance stat info in the slow query log, and the statement is common before statements on InnoDB tables.
因此,OP问题的答案是COMMIT
语句是缓慢的查询,而不是SET TIMESTAMP
.
Thus, the answer to OP's question is that the COMMIT
statement is the slow query and not the SET TIMESTAMP
.
这篇关于如何“设置时间戳"?是一个缓慢的查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!