What is the difference between a lock and a latch in the context of concurrent access to a database?

前端 未结 8 1659
别跟我提以往
别跟我提以往 2021-01-30 06:46

I am trying to understand a paper on concurrent B-tree, in which the author mentioned latch vs lock, and how latches do not need a \"Lock Manager\". I have been trying to figure

8条回答
  •  感情败类
    2021-01-30 07:23

    Quoting from OLTP Through the Looking Glass, and What We Found There by Stonebraker et al.

    Locking. Traditional two-phase locking poses a sizeable overhead since all accesses to database structures are governed by a separate entity, the Lock Manager.

    Latching. In a multi-threaded database, many data structures have to be latched before they can be accessed. Removing this feature and going to a single-threaded approach has a noticeable performance impact.

    This interpretation then associates locking with database level objects e.g. rows, whereas latches operate at the lower level of data structures.

提交回复
热议问题