Book Summary: Seventh chapter latch Suan Lock and Spin lock

Source: Internet
Author: User

Summary:

1. Latches are like memory locks, and as more and more threads participate, they scramble to access the same piece of memory, causing clogging.
2. The spin lock is the latch, and the difference is that if the access memory is not available, it will continue to check for a period of time.
3. Locking and spin locks are beyond our control and are automatically maintained by SQL Server, but we should actively look for ways to prevent them from clogging up.
4. When the ID is a clustered index, the last data page becomes a hotspot when the amount of data increases, and expropriation occurs.
Avoid tables with regular row data insertions using the self-increment ID instead of the GUID.
5. The data table for the queue operation should also avoid clustered index problems with IDs.
6. Whenever you insert data into a table without a clustered index, update the latch, tempdb is the hardest hit, and pay attention to the use of temporary tables.
7. Query statements with inline table-valued function clauses can also cause latch pressure to increase.
8. Omitting the schema name dbo, and the column name *, causes spin lock contention to occur.

Book Summary: Seventh chapter latch Suan Lock and Spin lock

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.