下面的示例显示服务器的执行、分析和编译时间。
USE AdventureWorks;
GO
SET STATISTICS TIME ON
GO
SELECT *
FROM Production.ProductCostHistory
WHERE StandardCost < 500.00;
GO
SET STATISTICS TIME OFF;
GO
下面是结果集:
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.
(269 row(s) affected)
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 2 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.
本文展示了如何使用SQL Server的STATISTICS TIME功能来查看SQL查询的解析、编译及执行时间。通过一个具体示例,详细解释了如何开启此功能并解读返回的时间数据。

被折叠的 条评论
为什么被折叠?



