当前位置:网站首页>MySQL storage engine
MySQL storage engine
2022-07-05 12:13:00 【ziyi813】
MySQL Storage engine for
Concept
Database storage engine is the bottom layer of database , Database management system uses data engine to create 、 Inquire about 、 Update and delete data
Different storage engines provide different storage mechanisms 、 Indexing mechanism , Locking mechanism .MySQL The core is the storage engine .
Users can choose different storage engines for data tables according to different requirements .
-- see MySQL All execution engines , The default engine is innoDB, Row level locking and foreign keys
-- The way 1
show engines
-- The way 2
show variables like 'have%';
MySQL In support of 9 Storage engine , The default engine is InnoDB
Field parameter interpretation :
Engine The parameter represents the name of the storage engine
Support parameter MySQL Whether the database management system supports the storage engine
Comment Parameters represent comments about the storage engine
Transactions Parameter indicates whether the storage engine supports transactions
XA Parameter indicates whether the distributed supported by the storage engine is consistent with XA standard
Savepoints Parameter indicates whether the storage engine supports savepoints in transaction processing
Operate the default engine
-- Query the storage engine supported by the current database
show engines;
-- View the current default storage engine
-- Mode one :
adopt `show engines`,Support Field is default Is the default engine
-- Mode two :
show variables like '%storage_engine%';
-- View table engine (ENGINE= The following value is the current storage engine )
show create table table_name;
-- Specify the storage engine when creating a new table
create table (...) engine = MyISAM;
Modify the storage engine
modify MySQL The default storage engine of the database system :
open my.ini The configuration file , find default-storage-engine = INNODB
Change to the name of the engine you want to change , Need to restart mysql The service will take effect .
Modify the database table storage engine
alter table table_name engine = INNODB;
alter table table_name engine = MyISAM;
Select storage engine
Each storage engine has its own characteristics 、 Advantages and application scenarios .
Common storage engine characteristics table
characteristic | MyISAM | InnoDB | MEMORY |
---|---|---|---|
Storage limits | Yes | 64TB | Yes |
Transaction security | I won't support it | Support | I won't support it |
Locking mechanism | Table locks | Row lock | Table locks |
B Tree index | Support | Support | Support |
Hash index | I won't support it | I won't support it | Support |
Full-text index | Support | I won't support it | I won't support it |
Cluster index | I won't support it | Support | I won't support it |
Data caching | Support | Support | |
The index buffer | Support | Support | Support |
Data can be compressed | Support | I won't support it | I won't support it |
Space use | low | high | N/A |
Memory usage | low | high | secondary |
Batch insertion speed | high | low | high |
Support foreign keys | I won't support it | Support | I won't support it |
- MyISAM, Because the engine does not support transactions , Foreign keys are also not supported , So the access speed is relatively fast , It is applicable to scenarios that do not require transaction integrity .
- InnoDB, Support transactions , Submit with , Rollback and crash recovery , Than MyISAM Take up more disk space
- MEMORY, The storage engine uses memory to store data , So this engine is fast , But there is no security ,【 It would have used redis Other memory types NOSQL Database replacement 】
边栏推荐
- Linux安装部署LAMP(Apache+MySQL+PHP)
- Simply solve the problem that the node in the redis cluster cannot read data (error) moved
- Is investment and finance suitable for girls? What financial products can girls buy?
- mysql拆分字符串做条件查询
- 【load dataset】
- Pytorch weight decay and dropout
- Design of music box based on assembly language
- Flutter2 heavy release supports web and desktop applications
- Matlab boundarymask function (find the boundary of the divided area)
- Matlab superpixels function (2D super pixel over segmentation of image)
猜你喜欢
Mmclassification training custom data
【PyTorch预训练模型修改、增删特定层】
How to clear floating?
Splunk configuration 163 mailbox alarm
Take you two minutes to quickly master the route and navigation of flutter
Yolov5 target detection neural network -- calculation principle of loss function
Network five whip
Reinforcement learning - learning notes 3 | strategic learning
Error modulenotfounderror: no module named 'cv2 aruco‘
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
随机推荐
Hash tag usage in redis cluster
[yolov5.yaml parsing]
Redis master-slave mode
MySQL data table operation DDL & data type
pytorch-线性回归
自动化测试生命周期
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
JS for循环 循环次数异常
Matlab superpixels function (2D super pixel over segmentation of image)
II. Data type
Recyclerview paging slide
Pytorch MLP
Linux安装部署LAMP(Apache+MySQL+PHP)
codeforces每日5题(均1700)-第五天
手机 CPU 架构类型了解
Understand kotlin from the perspective of an architect
Simple production of wechat applet cloud development authorization login
什么是数字化存在?数字化转型要先从数字化存在开始
July Huaqing learning-1
Design of music box based on assembly language