当前位置:网站首页>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 】
边栏推荐
- Basic operations of MySQL data table, addition, deletion and modification & DML
- 【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】
- MySQL data table operation DDL & data type
- Linux安装部署LAMP(Apache+MySQL+PHP)
- ACID事务理论
- Multi table operation - sub query
- Liunx prohibit Ping explain the different usage of traceroute
- Seven polymorphisms
- Principle and performance analysis of lepton lossless compression
- Swift - enables textview to be highly adaptive
猜你喜欢
Check the debug port information in rancher and do idea remote JVM debug
Redis master-slave mode
【yolov5.yaml解析】
【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
yolov5目標檢測神經網絡——損失函數計算原理
Mongodb replica set
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
【TFLite, ONNX, CoreML, TensorRT Export】
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
Pytorch softmax regression
随机推荐
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
Linux安装部署LAMP(Apache+MySQL+PHP)
mysql拆分字符串做条件查询
pytorch-线性回归
Network five whip
一类恒等式的应用(范德蒙德卷积与超几何函数)
手机 CPU 架构类型了解
【TFLite, ONNX, CoreML, TensorRT Export】
Is investment and finance suitable for girls? What financial products can girls buy?
投资理财适合女生吗?女生可以买哪些理财产品?
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
Time tools
Matlab boundarymask function (find the boundary of the divided area)
Seven ways to achieve vertical centering
Sentinel sentinel mechanism of master automatic election in redis master-slave
byte2String、string2Byte
Check the debug port information in rancher and do idea remote JVM debug
II. Data type
互联网公司实习岗位选择与简易版职业发展规划
Read and understand the rendering mechanism and principle of flutter's three trees