当前位置:网站首页>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 】
边栏推荐
- Time tools
- Video networkstate property
- 1. Laravel creation project of PHP
- Read and understand the rendering mechanism and principle of flutter's three trees
- 【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- What is the difference between canvas and SVG?
- Matlab label2idx function (convert the label matrix into a cell array with linear index)
- Get all stock data of big a
- Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
猜你喜欢
【使用TensorRT通过ONNX部署Pytorch项目】
【yolov3损失函数】
Understand kotlin from the perspective of an architect
Reading notes of growth hacker
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
Mmclassification training custom data
自动化测试生命周期
[untitled]
Codeworks 5 questions per day (1700 average) - day 5
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
随机推荐
Acid transaction theory
【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
Design of music box based on assembly language
Seven ways to achieve vertical centering
Which domestic cloud management platform manufacturer is good in 2022? Why?
想问问,如何选择券商?在线开户是很安全么?
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Flutter2 heavy release supports web and desktop applications
The evolution of mobile cross platform technology
【Win11 多用户同时登录远程桌面配置方法】
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
1 plug-in to handle advertisements in web pages
Check the debug port information in rancher and do idea remote JVM debug
Simple production of wechat applet cloud development authorization login
互联网公司实习岗位选择与简易版职业发展规划
[upsampling method opencv interpolation]
Video networkstate property
Matlab struct function (structure array)
pytorch-多层感知机MLP