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