当前位置:网站首页>MySQL practice 45 lecture [row lock]
MySQL practice 45 lecture [row lock]
2022-07-03 03:06:00 【Little fish 2020】
List of articles
07 | The merits and demerits of line lock : How to reduce the impact of row locks on performance ?
InnoDB It supports row locking .
Row locks are locks for row records in the data table . That makes sense , For example, affairs. A Updated a line , And at this time business B Also update the same line , Then we have to wait for business A You can't update until the operation of .
Start with two-stage locking 
If you need to lock multiple rows in your transaction , The most likely cause of lock conflict 、 The lock most likely to affect concurrency should be put back as far as possible 
Deadlock and deadlock detection
When different threads in a concurrent system have cyclic resource dependency , The threads involved are waiting for other threads to release resources , It will cause these threads to enter the state of infinite waiting , Deadlock . Here I use row locks in the database as an example .
-- Query transaction lock wait time , Unit second , Non interactive
show variables like "innodb_lock_wait_timeout%"
set innodb_lock_wait_timeout=100;
innodb_lock_wait_timeout It refers to the maximum waiting time for a transaction to acquire resources ,
If the resource is not allocated after this time, the application will fail
-- Whether deadlock check is enabled
show variables like "innodb_deadlock_detect%"

Summary
innodb Row level locking is achieved by locking index records .
If update No index ,innodb Inside, the whole table is scanned row by row according to the primary key index Lock line by line , The lock is released uniformly when the transaction is committed .
边栏推荐
- Check log4j problems using stain analysis
- 用docker 連接mysql的過程
- [shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling
- I2C subsystem (II): I3C spec
- C language beginner level - pointer explanation - paoding jieniu chapter
- Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
- 疫情当头,作为Leader如何进行代码版本和需求开发管控?| 社区征文
- Getting started | jetpack hilt dependency injection framework
- What does it mean when lambda is not entered?
- 从输入URL到页面展示这中间发生了什么?
猜你喜欢

Force deduction ----- the minimum path cost in the grid

超好用的日志库 logzero
![ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc](/img/cb/145937a27ef08050a370d5a255215a.jpg)
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc

Add automatic model generation function to hade

Check log4j problems using stain analysis

Can netstat still play like this?

Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers

函数栈帧的创建与销毁

I2C 子系统(三):I2C Driver

Kubernetes cluster log and efk architecture log scheme
随机推荐
一文带你了解 ZigBee
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
tensor中的append应该如何实现
idea 加载不了应用市场解决办法(亲测)
Anhui University | small target tracking: large-scale data sets and baselines
Xiaodi notes
分布式事务
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
A2L file parsing based on CAN bus (2)
复选框的使用:全选,全不选,选一部分
Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
Use cve-2021-43893 to delete files on the domain controller
docker安装mysql
open file in 'w' mode: IOError: [Errno 2] No such file or directory
Find the storage address of the elements in the two-dimensional array
C language beginner level - pointer explanation - paoding jieniu chapter
I2C subsystem (III): I2C driver
力扣------网格中的最小路径代价
What does it mean when lambda is not entered?
How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?