MySQL慢查询日志通常按顺序显示以下一些条目.
SET timestamp=1268999330;
commit;
# User@Host: username[username] @ localhost []
# Query_time: 4.172700 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
SET timestamp=1268999330;
commit;
# User@Host: username[username] @ localhost []
# Query_time: 3.628924 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
SET timestamp=1268999330;
commit;
# User@Host: username[username] @ localhost []
# Query_time: 3.116018 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
...
Run Code Online (Sandbox Code Playgroud)
通常按顺序进行6-7"提交"查询.任何人他们是什么,以及他们每个人的先前查询是什么?
提前致谢.
该set timestamp
命令会影响自动时间戳列返回的值now
以及修改其行时收到的值。
这对于复制和回放日志是必要的。取决于当前时间的查询语义将始终完全匹配。(注意sysdate
忽略set timestamp
不同于now
)
日志将确保set timestamp
每当有新连接、mysql ping 或执行任何语句时都会记录时间戳。