SQL Server performance Tuning common methods

Source: Internet
Author: User

1. Check the database space usage to see which tables are consuming larger disk space

Execute the following statement:

SelectO.name, SUM (p.reserved_page_count) asReserved_page_count, SUM (p.used_page_count) asUsed_page_count, SUM ( CaseWhen (p.index_id<2) Then (p.in_row_data_page_count+P.lob_used_page_count+p.row_overflow_used_page_count)Elsep.lob_used_page_count+P.row_overflow_used_page_count End) asDataPages, SUM ( CaseWhen (p.index_id<2) then Row_countElse 0end) asrowcounts fromsys.dm_db_partition_stats p INNER join sys.objects o on p.object_id=o.object_id GROUP BY o.name ORDER BY rowcounts Desc
View Code

2. Viewing performance consumption through Activity monitor

Determine which statements consume more performance by the time the disk io,cpu takes, the number of logical reads and writes

3. View SQL statements by execution time, disk IO and execution plan, including compile execution time, index scan lookup, read and write, etc.

View the statement of the Execution time and table scan, logical read and write conditions of the SQL statement:

SET STATISTICS time on
SET STATISTICS IO on

SQL Server performance Tuning common methods

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.