MySQL查詢結果中Duration Time和Fetch Time的區別


stack overflow上網友給出的解釋為:https://stackoverflow.com/questions/9425134/mysql-duration-and-fetch-time 

Fetch time - measures how long transferring fetched results take, which has nothing to do with query execution. I would not consider it as sql query debugging/optimization option since fetch time depends on network connection, which itself does not have anything to do with query optimization. If fetch time is bottleneck then more likely there's some networking problem.

Note: fetch time may vary on each query execution.   

Duration time - is the time that query needs to be executed. You should try to minimize it when optimizing performance of sql query.

 大致意思為:

1、fetch time 是傳輸獲取結果所消耗的時間,與sql語句執行時間無關。由於fetch時間依賴網絡連接的快慢,所以不能作為優化sql語句時間參考。如果fetch time過長,需要檢查網絡原因。

2、fetch time 每次執行都可能會變化。

3、duration time 是執行sql語句所消耗的時間,對sql語句優化就是減少這個時間。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM