SQL Server 执行时间代表什么?

Tom*_*ter 5 sql-server ssms sql-server-2005 database-optimization

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

SET STATISTICS TIME ON
GO
SELECT TOP 10000 *
  FROM table
GO
SET STATISTICS TIME OFF;
GO
Run Code Online (Sandbox Code Playgroud)

并得到以下结果:

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.
Run Code Online (Sandbox Code Playgroud)

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

提前致谢!

小智 3

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

CPU时间=总CPU时间。

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