What does the statistical result of SQL Server statement execution time display mean?

Source: Internet
Author: User

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: Copy codeThe Code is as follows: 1 SET STATISTICS TIME ON
2 USE [pratice]
3 GO
4 SELECT * FROM [dbo]. [Orders]

Result:Copy codeThe Code is as follows: SQL Server Analysis and Compilation Time:
CPU time = 0 ms, occupied time = 0 ms.
SQL Server execution time:
CPU time = 0 ms, occupied time = 0 ms.
SQL Server execution time:
CPU time = 0 ms, occupied time = 0 ms.
SQL Server Analysis and Compilation Time:
CPU time = 0 ms, occupied time = 0 ms.
(Row 3 is affected)
SQL Server execution time:
CPU time = 109 milliseconds, occupied time = 2506 milliseconds.

The CPU time of a statement is divided into the compilation and execution phases. 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 preceding CPU time indicates the statement execution time.
The Occupied time refers to the total time used to read data from the disk and then process the data.
Compilation phase:
SQL Server Analysis and Compilation Time:
Execution phase:
SQL Server execution time:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.