简体   繁体   English

MySQL Workbench查询统计信息:服务器和客户端计时?

[英]MySQL Workbench Query Stats: Server and Client Timing?

I'm running queries from the MySQL Workbench and it allows you to see the stats for each query. 我正在从MySQL Workbench运行查询,它允许您查看每个查询的统计信息。 Part of these stats are "Timing (as measured at the client side)" and "Timing (as measured by the server side)". 这些统计信息的一部分是“ Timing(在客户端测量)”和“ Timing(在服务器端测量)”。 I've included an example of what this output looks like. 我提供了一个输出示例。

Timing stats from MySQL Workbench MySQL Workbench的时序统计

I'm wondering why the timing on the server side is longer than on the client side. 我想知道为什么服务器端的时间比客户端长。 I may be completely wrong but I thought that the client side takes into account server time and a latency until the information is outputted, which would make the time measured by the client side longer. 我可能完全错了,但我认为客户端要考虑服务器时间和输出信息之前的延迟,这会使客户端测量的时间更长。

I'm new to this and not very familiar with execution timing but the workbench manual didn't offer much help and assumed I already understood what the values meant and how they worked. 我对此并不陌生,对执行时间不太熟悉,但是工作台手册并没有提供太多帮助,并且假定我已经了解这些值的含义以及它们的工作方式。 Any help is appreciated! 任何帮助表示赞赏!

I can't confirm this with documentation but running a quick test on a really large query and playing with the number of rows returned to the client results grid provided a possible insight: 我无法通过文档来证实这一点,但是可以对一个非常大的查询进行快速测试,并处理返回到客户端结果网格的行数,这可能提供了一些见解:

Dont Limit: 不限制:

Timing (as measured at client side): Execution time: 0:00:0.77752995 时间(以客户端为准):执行时间:0:00:0.77752995

Timing (as measured by the server): Execution time: 0:00:7.46805535 时间(由服务器衡量):执行时间:0:00:7.46805535

Table lock wait time: 0:00:0.00018100 表锁等待时间:0:00:0.00018100

Duration / Fetch time in "Action Output" pane: 0.778s / 7.723 sec “操作输出”窗格中的持续时间/获取时间:0.778秒/7.723秒

10 Rows 10排

Timing (as measured at client side): Execution time: 0:00:0.38576984 时间(以客户端为准):执行时间:0:00:0.38576984

Timing (as measured by the server): Execution time: 0:00:0.00058682 时间(由服务器衡量):执行时间:0:00:0.00058682

Table lock wait time: 0:00:0.00018400 表锁等待时间:0:00:0.00018400

Duration / Fetch in "Action Output" pane: 0.386 / 0.00002 sec 持续时间/在“操作输出”窗格中提取:0.386 / 0.00002秒

It just makes sense to me that the server measures from the time the client started asking for records to the time it stopped, and the client measures the time it takes the server to generate the number of records it needs. 对我而言,服务器从客户端开始请求记录到停止记录的时间进行度量,客户端对服务器生成所需记录数所花费的时间进行度量。 Perhaps to return an "accurate" execution time is to set the rows to return to "No Limit" and check the "Duration" in the "Action Output" pane. 可能要返回“准确的”执行时间是将行设置为返回“无限制”,然后在“动作输出”窗格中检查“持续时间”。

I've posted on the MySQL forum, hoping to get an explanation, will post back here if forthcoming. 我已经在MySQL论坛上发布了,希望得到解释,如果将来会在这里发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM