4

我有一个查询,我在两个等效数据库上运行,但托管在单独的 MS SQL 2005 服务器上。我想测量两台服务器上查询的时间,因此尝试了以下操作:

SET STATISTICS TIME ON
GO
SELECT TOP 10000 *
  FROM table
GO
SET STATISTICS TIME OFF;
GO

并得到以下结果:

SQL Server parse and compile time: 
   CPU time = 0 ms, elapsed time = 2 ms.

(10000 row(s) affected)

SQL Server Execution Times:
   CPU time = 16 ms,  elapsed time = 8143 ms.
SQL Server parse and compile time: 
   CPU time = 0 ms, elapsed time = 0 ms.

我的问题是,SQL Server 执行时间是什么意思?是仅在数据库中执行查询,还是执行查询,包括将数据传输回运行 SQL Server Management Studio 的客户端?

提前谢谢!

4

1 回答 1

3

已用时间 = 运行查询的总时间(包括等待 I/O)

CPU时间=总CPU时间。

有关该主题的有用文章位于http://www.sqlservercentral.com/articles/Performance+Tuning/measuringperformance/1323/

于 2010-06-22T11:02:45.193 回答