MySQL WorkBench-持续时间+提取时间<实际等待时间 [英] MySQL WorkBench - How come the Duration time + Fetch time < real waiting time

查看:569
本文介绍了MySQL WorkBench-持续时间+提取时间<实际等待时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在mySQL Workbench中运行查询.从查询开始到显示结果需要5分钟.尽管如此,仍显示了以下处理"时间(在WorkBench输出面板中):

I am running a query in mySQL Workbench. It takes 5 minutes from the start of the query to the display of the results. Nevertheless, the following "processing" times are shown (in WorkBench output panel):

  • 持续时间:0.000秒
  • 获取:2.562秒

问题:如何解释这种差异:5分钟对2.562秒?

Question : how can this difference be explained : 5 min vs 2.562 sec ?

顺便说一句:这个问题不是人们问持续时间和提取时间有什么区别的重复...

BTW : this question is not a duplicate of people asking what the difference between duration and fetch is...

推荐答案

我想问题出在查询执行时间Duration上.我怀疑统计信息没有考虑磁盘访问,并且您可能缺少某些索引.另一个原因是可能会有等待锁定的时间,应该考虑到这一点.

I guess the problem is with Duration, the query execution time. I suspect the stats are not taking into account disk access and you might be missing some index. The other reason is that there can be waiting times for locking, which is supposed to be accounted for.

您可以执行以下操作以获取有关查询花费时间的更多详细信息.

You can do the following to have more details on where your query spends time.

set profiling=1;
<run your query>
show profiles;
show profile for query 1;

这篇关于MySQL WorkBench-持续时间+提取时间&lt;实际等待时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆