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语句优化就是减少这个时间。