Test SQL statement Performance

Source: Internet
Author: User

Sometimes we often worry about the low execution efficiency of our SQL statements. After repeated optimization, it will not be improved.

Then you can use this statement to find out where your SQL is slow.

Example:

Set statistics Io on
Set statistics time on
Go
--- The SQL statement you want to test
Select Top 100 * From tbl_cot_recstaticlist
Go
Set statistics profile off
Set statistics Io off
Set statistics time off

Display Information:

SQL Server Analysis and Compilation Time:

CPU time = 0 ms, occupied time = 59 Ms.

(100 rows affected) Table 'tbl _ cot_recstaticlist '. 1 scan count, 14 logical reads, 2 Physical reads, 992 pre-reads, 0 lob logical reads, 0 lob physical reads, and 0 lob pre-reads.

SQL Server execution time: CPU time = 0 ms, occupied time = 306 Ms.

SQL Server Analysis and Compilation Time: CPU time = 0 ms, time occupied = 1 ms.

SQL Server execution time: CPU time = 0 ms, occupied time = 1 ms.

SQL Server execution time: CPU time = 0 ms, occupied time = 1 ms.

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.