SQLQueryStress工具的指标解析
2024-03-08 15:01 潇湘隐者 阅读(226) 评论(0) 编辑 收藏 举报SQLQueryStress是SQL Server数据库的一个压测工具,这里不打算介绍这款工具,而是浅析一下SQLQueryStress工具的一些指标涵义。如有疏漏或不足之处,敬请指正。 如下截图所示,你会看到下面一些指标


那么对应指标的具体含义是啥呢?下面表格整理了这些指标的含义;

很多同学对于Client Seconds /Iteration(Avg)与Actual Seconds/Iteration(Avg)两个指标有所疑惑,搞不清它们的区别。关于它们的区别,官方文档[1]的简单描述如下:
There are three types of time statistics collected and displayed by the tool. The Client Seconds/Iteration box displays the average runtime over all iterations, as recorded on the client. The CPU Seconds/Iteration and Actual Seconds/Iteration boxes both display time statistics reported by SQL Server. The former is the average reported CPU time, and the latter is the average reported total query time. Another statistic collected and shown by the tool is the number of logical reads (which is an amalgamation of buffer cache and disk reads), in the Logical Reads/Iteration box.
其实,Client Seconds /Iteration(Avg)这个指标是SQLQueryStress这个工具统计的,所有线程执行完这个SQL的总时间/SQL执行次数。而Actual Seconds/Iteration(Avg)是SQL Server端统计的,一般是你开启了时间统计信息后服务器端统计的数据。
SET STATISTICS TIME ON;
SELECT * FROM [Maint].[JobHistoryDetails]
一般而言,Client Seconds /Iteration(Avg)指标的值小于或等于Actual Seconds/Iteration(Avg)指标的值,主要是因为查询数据从Server端传输到客户端,也是需要一定的时间的,这个时间跟你查询的数据量以及网络传输速度有关系。
参考资料
1: https://github.com/ErikEJ/SqlQueryStress/wiki

【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
2019-03-08 SQL Server作业报错特殊案例
2016-03-08 SQL SERVER普通用户需要什么权限才能执行sp_configure命令
2015-03-08 SQL SERVER 重组含有特殊字符的索引时遇到“关键字 'with' 附近有语法错误.”
2014-03-08 Linux Tomcat 6.0安装配置实践总结