select now(); select count(distinct url) from test orde..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

mysql.slow_log表里記錄的start_time是語句的什么時間?

發(fā)布時間:2020-08-08 06:33:08 來源:ITPUB博客 閱讀:286 作者:psufnxk2000 欄目:MySQL數(shù)據(jù)庫
mysql.slow_log表里記錄的start_time是語句的什么時間? 

答:語句的結(jié)束時間 

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 記錄的是語句的結(jié)束時間 


slow_log文件里記錄的內(nèi)容是 
# 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 值是一樣的, 都是語句的結(jié)束時間



轉(zhuǎn)載請注明源出處
QQ 273002188 歡迎一起學(xué)習(xí)
QQ 群 236941212
oracle,mysql,mongo 相互交流

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI