当前位置:网站首页>MySQL quotation sentence is unlocked: algorithm=insert, lock=none
MySQL quotation sentence is unlocked: algorithm=insert, lock=none
2022-06-30 07:57:00 【Floating across the sea】
Add index without lock on line : Quoted statements are unlocked
ALTER TABLE tbl_name ADD PRIMARY KEY (column), ALGORITHM=INPLACE, LOCK=NONE;
ALGORITHM=INPLACE
Better solutions , Index the current table , step :
1. Create index ( Secondary indexes ) The data dictionary
2. Add shared table lock , prohibit DML, Allow queries
3. Read cluster index , Construct a new index entry , Sort and insert
Enter new index
4. Wait for all read-only transactions that open the current table to commit
5. End of index creation
ALGORITHM=COPY
Create an index from a temporary table , Need twice as much storage , And more IO, step :
1. New with index ( primary key ) A temporary watch
2. Lock the original watch , prohibit DML, Allow queries
3. Copy the original table data to the temporary table
4. Read and write prohibited , Conduct rename, Upgrade dictionary lock
5. Finish creating index
LOCK=DEFAULT: Default mode ,MySQL Decide for yourself which one to use LOCK Pattern , Try not to lock the watch
LOCK=NONE: unlocked : allow Online DDL Concurrent read and write operations are performed during . If Online DDL fuck
Continue writing to the table is not supported , be DDL operation failed , Invalid for table modification
LOCK=SHARED: Shared lock :Online DDL Write blocked during operation , Does not affect reading
LOCK=EXCLUSIVE: Exclusive lock :Online DDL No operation is allowed on the lock table during operation
Then I found a solution with the help of alicloud
- In-Place?: Corresponding DDL Of the statement Algorithm Options , adopt inplace How to execute DDL. Compared with the table copy method , Can reduce space and I/O Consume .
- Copies Table?: Corresponding DDL Of the statement Algorithm Options , adopt Table copy How to execute DDL.DDL During execution, it will occupy more disk space and consume more I/O.
- Allow concurrency DML?: Corresponding DDL Of the statement Lock Options ,DDL Whether concurrency is supported during execution DML operation .
- Allow concurrent queries ?:DDL Whether concurrent query operations are supported during statement execution ( It is usually supported ).
- MySQL Please refer to the official documents :Online DDL overview
- DDL The metadata of the table needs to be modified during operation execution (metadata), You may encounter the situation of waiting for the metadata lock of the table (waiting for table metadata lock), Please refer to :RDS MySQL On the table Metadata lock Generation and treatment of
- Inplace and Copy Table It's the opposite 2 There are ways to deal with it ; But even if DDL Support Inplace Options , Some operations also involve table copying in the whole execution process , For example, add columns in the above table .
边栏推荐
- Acreems energy efficiency management platform escorts the power safety of high-rise residential areas
- 深度学习——LSTM
- Efga design open source framework fabulous series (I) establishment of development environment
- 深度学习——序列模型and数学符号
- Introduction notes to pytorch deep learning (XII) neural network - nonlinear activation
- Examen final - notes d'apprentissage PHP 3 - Déclaration de contrôle du processus PHP
- [tensorflow GPU] building of deep learning environment under windows11
- TP5 set direct download file
- Analysys analysis: online audio content consumption market analysis 2022
- 1162 Postfix Expression
猜你喜欢
![December 4, 2021 [metagenome] - sorting out the progress of metagenome process construction](/img/03/eb6e6092922cf42c2c9866e7bb504d.jpg)
December 4, 2021 [metagenome] - sorting out the progress of metagenome process construction

Multi whale capital: report on China's education intelligent hardware industry in 2022

深度学习——循环神经网络

Examen final - notes d'apprentissage PHP 3 - Déclaration de contrôle du processus PHP

期末複習-PHP學習筆記5-PHP數組

What management improvements can CRM bring to enterprises
![November 22, 2021 [reading notes] - bioinformatics and functional genomics (Section 5 of Chapter 5 uses a comparison tool similar to blast to quickly search genomic DNA)](/img/de/7ffcc8d6911c499a9798ac9215c63f.jpg)
November 22, 2021 [reading notes] - bioinformatics and functional genomics (Section 5 of Chapter 5 uses a comparison tool similar to blast to quickly search genomic DNA)
![[tensorflow GPU] building of deep learning environment under windows11](/img/10/6d30d4c310e6677049a1012d47f773.png)
[tensorflow GPU] building of deep learning environment under windows11

期末复习-PHP学习笔记3-PHP流程控制语句

Deep learning -- feature point detection and target detection
随机推荐
Construction of energy conservation supervision system for campus buildings of ankery University
Inversion Lemma
December 19, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)
Hit the industry directly | the flying propeller launched the industry's first model selection tool
期末复习-PHP学习笔记4-PHP自定义函数
深度学习——网络中的网络以及1x1卷积
Final review -php learning notes 1
F12抓包用于做postman接口测试的全过程解析
What management improvements can CRM bring to enterprises
String and underlying character types of go data type
Permutation and combination of probability
深度学习——残差网络ResNets
2021.11.20 [reading notes] | differential variable splicing events and DTU analysis
Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间) 日期格式化
Given a fixed point and a straight line, find the normal equation of the straight line passing through the point
Deep learning - brnn and DRNN
Bingbing learning notes: quick sorting
2021-10-27 [WGS] pacbio third generation methylation modification process
Introduction notes to pytorch deep learning (XII) neural network - nonlinear activation
回文子串、回文子序列