• MySQL知识库 :: innodb
  • What is predicate locking?

  • Discussion

    Predicate locking is a method of locking based upon logical conditions as a solution to so-called phantom rows, such that if a transaction has issued SELECT ... WHERE age > 18, no other transaction would be able to add new rows where age greater than 18, delete rows where age greater than 18, or update an existing row so that it would conflict with the initial transaction.

    It is generally considered too expensive to implement, however the InnoDB storage engine uses index locking and next-key/gap locking as an alternative solution to this problem. More information can be found in the on-line documentation (see the external resources links in the margin).