Understanding mysql locks (1) Overview

Source: Internet
Author: User


Understanding mysql locks (1) Overview of locks compared with other databases, MySQL locks are relatively simple. The most notable feature is that different memory engines support different locks, however, mysql memory engines use three types of locking mechanisms: row locking, table locking, and table locking. MyISAM mainly uses table-level locking, while Innodb uses row locking. ① Table locking: a small number of locks are opened, and locks are fast. No deadlocks are generated. The lock granularity is large, with the highest probability of lock conflicts and the lowest concurrency. Www.2cto.com
(2) rows of locks: the locks are too large to be opened, and the locks are slow. Deadlocks may occur. The minimum lock granularity, the lowest probability of lock conflicts, and the highest concurrency.
③ Locking locks: The time for unlocking and locking is between the table lock and the row lock. A deadlock occurs. The lock granularity is between the table lock and the row lock, concurrency is average. Each lock is designed based on its own application scenarios. Table locks may be suitable for web applications, while row-level locks may be more suitable for OLTP systems.

Related Article

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.