MySQL mysql持续时间和获取时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9425134/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:14:55  来源:igfitidea点击:

mysql duration and fetch time

mysqlmysql-workbench

提问by user1189851

I am using MySQL workbench - What is the difference between duration and fetch times when a query is run?

我正在使用 MySQL 工作台 - 运行查询时持续时间和获取时间之间有什么区别?

Also is there a way I can enable the microsecond option in MySQL?

还有一种方法可以在 MySQL 中启用微秒选项吗?

回答by Leri

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.

获取时间- 衡量传输获取的结果需要多长时间,这与查询执行无关。我不会将其视为 sql 查询调试/优化选项,因为获取时间取决于网络连接,而网络连接本身与查询优化无关。如果获取时间是瓶颈,那么更有可能存在一些网络问题。

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.

持续时间- 是查询需要执行的时间。在优化 sql 查询的性能时,您应该尽量减少它。

Reference

参考

回答by Kurt

Duration shows the time needed to execute the query and fetch is the time needed to read the result set (retrieve the data)

Duration 显示执行查询所需的时间,fetch 是读取结果集(检索数据)所需的时间

I am unsure about the microsecond option. If this is in regards to optimization, remember - "premature optimization is the root of all evil"

我不确定微秒选项。如果这是关于优化,请记住 - “过早的优化是万恶之源”

回答by Spark8006

About the microsecond, try to enable it in the Preferences menu, and I also got a question about the duration and fetch time before, now I seems get the answer that the duration is the execution time of the query, and the fetch is retrieve the result and send them to wherever you want. For example, I get a query which duration time is 0.078 but will take 60 secs to send the data back to my website.

关于微秒,尝试在首选项菜单中启用它,之前我也有一个关于持续时间和获取时间的问题,现在我得到的答案是持续时间是查询的执行时间,而获取是检索结果并将它们发送到您想要的任何地方。例如,我收到一个持续时间为 0.078 的查询,但将数据发送回我的网站需要 60 秒。

回答by Satyam

Execution time is time spent preparing the query and running the query AND The fetch time is time spent pulling-in the row results

执行时间是准备查询和运行查询所花费的时间 AND 提取时间是拉入行结果所花费的时间