SqlServer statement displays execution performance

Official details Reference: https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2008-r2/ms190287(v=sql.105)

1, shows the number of milliseconds required to parse, compile, and execute each statement.

--TF_POS table query
SET STATISTICS TIME ON 
GO 
SELECT * FROM TF_POS
GO
SET STATISTICS TIME OFF;
GO 

  The results are shown as follows: 

     SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 6 ms.
    (608 rows affected)
    SQL Server execution time: CPU time = 31 ms, elapsed time = 920 msec.
    SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 0 ms.

2, SQL Server displays information about the amount of disk activity generated by Transact-SQL statements.

 

SET STATISTICS IO ON
GO 
SELECT * FROM TF_POS
GO
SET STATISTICS IO OFF
GO

 

   The results are shown as follows:  

        (608 rows affected)

        Table 'TF_POS'. Scan count 1, logical reads 106, physical reads 0, read-ahead 0, lob logical reads 0, lob physical reads 0, lob read-ahead 0 times.

Guess you like

Origin www.cnblogs.com/approx/p/12038798.html