During SQL statement optimization, most of them will view the statement execution time. What is the statistical result displayed by SQLSERVER? The following is a simple example: 1SETSTATISTICSTIMEON2USE [pratice] 3GO4SELECT * FROM [dbo]. [Orders] Result: 1SQLServer analysis and editing
During SQL statement optimization, most of them will view the statement execution time. What is the statistical result displayed by SQLSERVER? The example below is a simple statement: 1 set statistics time on 2 USE [pratice] 3 GO 4 SELECT * FROM [dbo]. [Orders] Result: 1 SQL Server Analysis and editing
During SQL statement optimization, most of them will view the statement execution time. What is the statistical result displayed by SQLSERVER?
The following is an example.
Simple statement:
1 SET STATISTICS TIME ON2 USE [pratice]3 GO4 SELECT * FROM [dbo].[Orders]
Result:
1. SQL Server Analysis and Compilation Time: 2. CPU time = 0 ms, and time used = 0 ms. 3 4 SQL Server execution time: 5 CPU time = 0 ms, occupied time = 0 ms. 6 7 SQL Server execution time: 8 CPU time = 0 ms, occupied time = 0 ms. 9 SQL Server Analysis and Compilation Time: 10 CPU time = 0 ms, occupied time = 0 ms. 11 12 (121317 rows affected) 13 14 SQL Server execution time: 15 CPU time = 109 ms, occupied time = 2506 Ms.
CPU time of the statementCompilation phaseAndExecution phase. The optimizer should first figure out how many CPU resources are used in each phase.
Then, let's see if there is any possibility of optimizing and reducing CPU usage.
The aboveCPU timeThe time when the statement is executed.
WhileTime usedIndicates the total time used to read data from a disk and then process the data.
Compilation phase:
SQL Server Analysis and Compilation Time:
Execution phase:
SQL Server execution time: