当前位置:网站首页>Let me understand your MySQL storage engine
Let me understand your MySQL storage engine
2022-07-22 08:56:00 【Endless learning java】
An article that makes you understand Mysql Storage engine
MySQL Architecture
adjoining course
At the top are some clients and link services , Mainly completes some similar to the connection processing 、 Authorized certification 、 And related safety programs . The server will also provide secure access for each client
The client verifies its operation permissions .
Service layer
The second layer architecture mainly completes most of the core service functions , Such as SQL Interface , And complete the cache query ,SQL Analysis and optimization of , Execution of some built-in functions . All cross storage
The function of storage engine is also realized in this layer , Such as The process 、 Functions, etc .
Engine layer
The storage engine is really responsible for MySQL The storage and extraction of data in , Server pass API Communicating with the storage engine . Different storage engines have different functions , So I
We can according to our own needs , To choose the right storage engine .
Storage layer
Mainly store the data on the file system , And complete the interaction with the storage engine .
Introduction to storage engine
The storage engine is to store data 、 Index 、 to update / Implementation of query data and other technologies . The storage engine is table based , Not library based , So the storage engine can also be
Called table type .
- When the table is created , Specify the storage engine
- View the storage engines supported by the current database
SHOW ENGINES;
Storage engine features
InnoDB
* Introduce
InnoDB It is a general storage engine with high reliability and high performance , stay MySQL 5.5 after ,InnoDB By default MySQL Storage engine .
* characteristic
DML Operation follows ACID Model , Support transactions ;
Row-level locks , Improve concurrent access performance ;
Support foreign keys FOREIGN KEY constraint , Ensure the integrity and correctness of data ;
* file
xxx.ibd:xxx Represents the table name ,innoDB Each table of the engine will correspond to such a tablespace file , The table structure that stores the table (frm、sdi)、 Data and index .
Parameters :innodb_file_per_table
InnoDB
MyISAM
* Introduce
MyISAM yes MySQL Early default storage engine .
* characteristic
Unsupported transaction , Foreign key not supported
Support table lock , Row locks are not supported
Fast access
* file
xxx.sdi: Store table structure information
xxx.MYD: Store the data
xxx.MYI: Storage index
Memory
* Introduce
Memory The table data of the engine is stored in memory , Due to hardware problems 、 Or the impact of power failure , These tables can only be used as temporary tables or caches .
* characteristic
Memory storage
hash Indexes ( Default )
* file
xxx.sdi: Store table structure information
difference
Storage engine selection
When choosing a storage engine , The appropriate storage engine should be selected according to the characteristics of the application system . For complex applications , You can also select a variety of storage engines to group according to the actual situation
close .
* InnoDB : yes Mysql The default storage engine for , Support transactions 、 Foreign keys . If the application has higher requirements for transaction integrity , Data consistency is required under concurrent conditions , Data operations in addition to inserts and queries , It also contains a lot of updates 、 Delete operation , that InnoDB The storage engine is a better choice .
* MyISAM : If the application is based on read operation and insert operation , There are very few update and delete operations , And the integrity of the transaction 、 Concurrency requirements are not very high , So it's very appropriate to choose this storage engine .
* MEMORY: Keep all data in memory , Fast access , Usually used for temporary tables and caches .MEMORY The drawback is that there is a limit on the size of the table , Too large tables cannot be cached in memory , And can't guarantee the security of data .
边栏推荐
- Ffmpeg audio decoding (seconds understand)
- Self study golang [3.3go language loop statement] for loop syntax structure, omit initial conditions, omit incremental conditions, omit the application of end conditions
- Depth analysis of pointer "Five"
- File operation and related functions
- Is it safe for Galaxy Securities VIP to open an account with low commission? Is it a hoax?
- Error: a connection was successfully established with the server, but
- 海思Hi3531||瑞芯微RK1109用rtsp服务器实现h264推流
- Linear table * sequential table (7000 words detailed explanation)
- 海思[Hi3531]GPIO亮灯应用程序和寄存器操作
- How to open an account for agricultural futures? Who can open Everbright futures?
猜你喜欢
Self study golang [Chapter 1: basic knowledge of go language] Why do you want to learn go language? The relationship between go language and C language? Founder of go language? What are the characteri
指针深度解刨《三》(数组的认知)
海思[Hi3531]GPIO亮灯应用程序和寄存器操作
交易进阶必由之路:从小白到稳定盈利(三)
基于[海思Hi3516dv300]开发的内核定时器中断
多线程与线程池
OSPF 重发布
OSPF routing control
TPS trading strategy with a winning rate of 93.98%
Pointer depth solution "four" (the "intimate" relationship between pointer and array)
随机推荐
2021-09-23
scrollIntoView
js bind
[C语言] 文件操作《一》
Vscode add custom comment
How to judge the trend in quantitative trading
What is RPA? Recommend automated tools that allow e-commerce operators to operate 10 times more efficiently
Sharing the ultimate breakthrough strategy used by professional traders for many years (with a full set of trading templates)
Continuously improve cognition, so as to reach the highest level of trading - stable profits (I)
Pointer depth solution "three" (array cognition)
去除tinymce中粘贴的样式
How to build a smart park with 5g and mobile edge computing servers
Excel中时间戳和时间的转换
不断提升认知,从而达到交易的最高级别——稳定盈利(二)
Pytorch learning (I): linear regression
Is it safe for Galaxy Securities VIP to open an account with low commission? Is it a hoax?
Formation and destruction of function stack frames (26 pictures help you understand function stack frames in depth)
C# textbox密码框设置
鼠标移入select options会触发mouseleave 事件处理方案
serialization and deserialization