MySQL一般查询日志输入顺序 [英] MySQL general query log entry order
本文介绍了MySQL一般查询日志输入顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将MySQL的常规查询日志定向到general_log
表,它具有类型为timestamp
的event_time
列-分辨率为1sec.也没有自动递增的id
列.
When directing MySQL's General Query Log to a general_log
table, it has an event_time
column of type timestamp
- which has a resolution of 1sec. Also there is no auto-increment id
column.
如果多个日志条目具有相同的时间戳记(发生在同一秒)-我如何知道它们的顺序?
If multiple log entries have the same timestamp (occur on same second) - how can I know their order?
(如果您知道按查询顺序记录查询的完全不同的方法,也请共享)
(If you know of a completely different approach to logging the queries by their order, please do share as well)
推荐答案
总结我的理解和上面的评论:
Summing up my understandings and the comments above:
- 一般查询日志(GQL)条目按接收到的顺序写入,可能与它们执行的顺序不同
- 独立GQL的分辨率仅为1秒
- MySQL的二进制日志似乎是唯一的方法获得更好的分辨率
- General Query Log (GQL) entries are written in the order received, which might differ from the order in which they are executed
- Indeed GQL has a resolution of only 1sec
- MySQL's binary log seems the only way to get better resolution
这篇关于MySQL一般查询日志输入顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文