SQL Server Performance Optimization Research Report

Source: Internet
Author: User

Take the stored procedure for lesson selection as an example:

To add to the jargon, a simple personal understanding: physical reads "read from memory", logical reads "Read through logical Structure", and physical reads are much less efficient than logical reads.

1. Add index in selected timetable (large amount of data)

SELECTExperimentalprojectname fromExperimentalarrangementWHEREIdinch(SELECTExperimentalarrangementid fromExperimentopenWHEREIdinch(SelectExperimentopenid fromCourserecordWHERETermid=(SELECTId fromSemesterWHERETermstate=1) andStudentID=33371))
View Code

View index:

Sp_helpindex ' Courserecord '

Query efficiency in the case of an index:

Results of Database Engine Tuning Advisor

Test sales of queries after deleting an index

DROP INDEX courserecordindex on Courserecord;

Optimization results for not adding semester IDs in the index

Only semester ID is added to the index without the optimization result of student ID

As a result, only adding termid as the result of the index is the same as the result of not adding an index, and the prediction should be that the amount of data in the semester table is very small, which results in the optimization effect is not obvious.

Conclusion: How to build index to improve efficiency, the first index of the Table object data volume must be huge, so that there will be obvious efficiency improvement effect; Furthermore, indexed objects, such as the data volume of the main table corresponding to the external code, are huge.

SQL Server Performance Optimization Research Report

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.