What is Latch in SQL Server?

Rabia Kurnaz 386 Reputation points
2022-09-12T13:40:30.817+00:00

What is Latch? Why we use latch? Why we need latch? Please give me more examples.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,671 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,624 questions
0 comments No comments
{count} votes

Accepted answer
  1. NikoXu-msft 1,911 Reputation points
    2022-09-13T02:00:36.63+00:00

    Hi @Rabia Kurnaz ,

    A latch is a lightweight synchronization object used by the Storage Engine of SQL Server to protect internal memory structures that can’t be accessed in a true multi-threaded fashion. In the first part of the blog posting I will talk about why there is a need for latches in SQL Server, and in the second part I will introduce various latch types to you, and how you can troubleshoot them.
    For more details, please see:
    https://www.watelectronics.com/what-is-a-latch-different-types-and-their-applications/
    https://www.sqlpassion.at/archive/2014/06/23/introduction-to-latches-in-sql-server/#:~:text=A%20latch%20is%20a%20lightweight%20synchronization%20object%20used,can%E2%80%99t%20be%20accessed%20in%20a%20true%20multi-threaded%20fashion.

    Best regards
    Niko

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Tom Phillips 17,731 Reputation points
    2022-09-12T16:40:03.717+00:00
    1 person found this answer helpful.

  2. Olaf Helper 44,296 Reputation points
    2022-09-12T13:55:39.303+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.