MySQL WorkBench - how did the duration time + fetch time turn out <real wait time
I am running a query in mySQL Workbench. It takes 5 minutes from starting the query to displaying the results. However, the "processing time" is displayed (in the WorkBench output pane):
- Duration: 0.000s
- Fetch: 2.562 s
The question is, how do you explain this difference: 5 minutes versus 2.562 seconds?
BTW: This question does not duplicate people asking what's the difference between duration and sample ...
+3
source share
1 answer
I think the problem has to do with Duration, the execution time of the request. I suspect the statistics don't take into account disk access and you may be missing some index. Another reason is that there might be a lock timeout that should be accounted for.
You can do the following to get more information about where your request is spending time.
set profiling=1; <run your query> show profiles; show profile for query 1;
+1
source share