资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

mysql.slow_log表里记录的start_time是语句的什么时间?

MySQL.slow_log表里记录的start_time是语句的什么时间? 

答:语句的结束时间 

mysql> select now(); select count(distinct url) from test order by url asc ,example desc ; 
+---------------------+ 
| now() | 
+---------------------+ 
| 2016-01-18 16:25:19 | 
+---------------------+ 
1 row in set (0.00 sec) 

+---------------------+ 
| count(distinct url) | 
+---------------------+ 
| 199 | 
+---------------------+ 
1 row in set (16.15 sec) 



mysql> select *from mysql.slow_log order by start_time desc limit 10\G 
*************************** 1. row *************************** 
start_time: 2016-01-18 16:25:35 
user_host: root[root] @ localhost [] 
query_time: 00:00:16 
lock_time: 00:00:00 
rows_sent: 1 
rows_examined: 824832 
db: test 
last_insert_id: 0 
insert_id: 0 
server_id: 168039296 
sql_text: select count(distinct url) from test order by url asc ,example desc 
thread_id: 4 
1 row in set (0.00 sec) 

start_time为16:25:35 减去query_time: 00:00:16 等于 16:25:19 

所以start_time 记录的是语句的结束时间 


slow_log文件里记录的内容是 
# Time: 160118 16:25:35 
# User@Host: root[root] @ localhost [] Id: 4 
# Query_time: 16.152763 Lock_time: 0.000102 Rows_sent: 1 Rows_examined: 824832 
SET timestamp=1453105535; 
select count(distinct url) from test order by url asc ,example desc; 
time和timestamp 值是一样的, 都是语句的结束时间



转载请注明源出处
QQ 273002188 欢迎一起学习
QQ 群 236941212
oracle,mysql,mongo 相互交流


网站名称:mysql.slow_log表里记录的start_time是语句的什么时间?
网页URL:http://www.cdkjz.cn/article/jiocjs.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220