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

 

posted @   无敌师爷IT技术Blog  阅读(3635)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
历史上的今天:
2019-06-28 无法嵌入互操作类型“ApplicationClass”。请改用适用的接口 - Microsoft.Office.Interop.Word.ApplicationClass
点击右上角即可分享
微信分享提示