当前位置:网站首页>Storage engine analysis
Storage engine analysis
2022-06-30 01:04:00 【Hua Weiyun】
Storage engine
MySQL Architecture :


The storage engine is to store data 、 Index 、 to update / Implementation of query data and other technologies . The storage engine is based on tables rather than libraries , So the storage engine can also be called the table engine . The default storage engine is InnoDB.
The relevant operation :
-- Query table creation statement show create table account;-- Specify the storage engine when creating the table CREATE TABLE Table name ( ...) ENGINE=INNODB;-- View the storage engines supported by the current database show engines;InnoDB
InnoDB It is a general storage engine with high reliability and high performance , stay MySQL 5.5 after ,InnoDB By default MySQL engine .
characteristic :
- DML Operation follows ACID Model , Support Business
- Row-level locks , Improve concurrent access performance
- Support Foreign keys constraint , Ensure the integrity and correctness of data
file :
- xxx.ibd: xxx Representative 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, Decide whether multiple tables share a tablespace or each table corresponds to a tablespace
Knowledge point :
see Mysql Variable :show variables like 'innodb_file_per_table';
from idb File extraction table structure data :( stay cmd function )ibd2sdi xxx.ibd
InnoDB Logical storage structure :

MyISAM
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
Memory The table data of the engine is stored in memory , Affected by hardware problems 、 The impact of power failure , These tables can only be used as temporary tables or caches .
characteristic :
- Store in memory , Fast
- hash Indexes ( Default )
file :
- xxx.sdi: Store table structure information
Storage engine features
Choice of storage engine
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 combine according to the actual situation .
- InnoDB: If the application has higher requirements for the integrity of things , Data consistency is required under concurrent conditions , Data operations in addition to inserts and queries , It also contains a lot of updates 、 Delete operation , be InnoDB It 's 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 、 The requirement of concurrency is not high , Then this storage engine is very suitable .
- Memory: Keep all data in memory , Fast access , Usually used for temporary tables and caches .Memory The limitation of table size is the limitation of table size , Too large tables cannot be cached in memory , And can't guarantee the security of data
Footprints and comments in e-commerce are suitable for MyISAM engine , Cache is suitable for Memory engine .
边栏推荐
- Time flies that year
- 【Proteus仿真】8位端口检测8独立按键
- Experience of C language course design: open source sharing of "push box" course design works
- 阿于的彩虹桥
- 2020-12-03
- What if you can't write your composition well? Ape counseling: parents should pay attention to these points
- Interviewer: how to solve the problem of massive requests for data that does not exist in redis, which affects the database?
- ResizeKit2.NET大小和分辨率独立
- 如何统一项目中包管理器的使用?
- 岁月不饶人
猜你喜欢

What if you can't write your composition well? Ape counseling: parents should pay attention to these points

Programmers with a monthly salary of less than 30K must recite the interview stereotype. I will eat it first!

CSV文件格式——方便好用个头最小的数据传递方式

如何查看一个文件夹下所有文件的大小?

Equivalence class partition method for test case design method

Seata and the three platforms are working together in the summer of programming. Millions of bonuses are waiting for you

练习副“产品”:自制七彩提示字符串展示工具(for循环、if条件判断)

Solving plane stress problem with MATLAB

Crmeb SMS for program configuration of knowledge payment system

优秀的测试/开发程序员与普通的程序员对比......
随机推荐
xshell中怎么切换到root用户
Antd - tree structure: default deployment node attribute failure - Basic promotion
【Proteus仿真】8位端口检测8独立按键
What are the top ten securities companies? In addition, is it safe to open a mobile account?
数字垃圾是什么?跟随世界第一位AI艺术家,探索元碳艺术
numpy的索引和图片的索引一样吗?
Too voluminous ~ eight part essay, the strongest king of interview!
Lower expectations
Text classification using huggingface
Go out and protect yourself
The SQL statement concat cannot find the result
Simple pages
手写C语言之函数的嵌套调用和链式访问
post请求出现WebKitFormBoundaryk的解决办法
Programmers with a monthly salary of less than 30K must recite the interview stereotype. I will eat it first!
Crmeb SMS for program configuration of knowledge payment system
MySql函数
In 2022, the latest and most detailed idea associated database method and visual operation of database in idea (including graphic process)
练习副“产品”:自制七彩提示字符串展示工具(for循环、if条件判断)
Good test / development programmers vs. average programmers