当前位置:网站首页>Introduction to four MySQL engines
Introduction to four MySQL engines
2022-06-29 00:10:00 【hay_ lee】
(1):MyISAM Storage engine
Unsupported transaction 、 Foreign keys are also not supported , The advantage is fast access , There is no... For transaction integrity Ask for or with select,insert The main application can basically use this engine to create tables
Support 3 Different storage formats , Namely : Static table ; Dynamic table ; Compression meter
Static table : The fields in the table are all non variable length fields , So every record is a fixed length , Advantages storage is very fast , Easy to cache , It's easy to recover in case of failure ; The disadvantage is that it usually takes up more space than a dynamic table ( Because the space will be filled according to the width of the column definition when storing )ps: When I get the data , By default, the space after the field is removed , If you don't pay attention, you will ignore the spaces in the data itself .
Dynamic table : Records are not fixed length , The advantage of this storage is that it takes up less space ; shortcoming : Frequent updates 、 Deleting data is prone to fragmentation , It needs to be carried out on a regular basis OPTIMIZE TABLE perhaps myisamchk-r Command to improve performance
Compression meter : Because each record is compressed individually , So there's only a very small cost of access
(2)InnoDB Storage engine *
The storage engine provides 、 Transaction security of rollback and crash recovery capability . But contrast MyISAM engine , The efficiency of writing will be lower , And it will take up more disk space to keep data and index .
InnoDB Features of the storage engine : Support auto grow Columns , Support for foreign key constraints
(3):MEMORY Storage engine
Memory The storage engine uses what is in memory to create tables . Every memory Table only corresponds to one disk file , The format is .frm.memory Table access of type is very fast , Because its data is in memory , And by default HASH Indexes , But once the service is shut down , The data in the table will be lost .
MEMORY The table of the storage engine can choose to use BTREE Index or HASH Indexes , Two different types of indexes have different scopes of use
Hash Indexing benefits :
Hash The particularity of index structure , Its retrieval efficiency is very high , The index can be retrieved at one time , Unlike B-Tree The index needs to be from the root node to the branch node , Finally, you can access the page node for many times IO visit , therefore Hash The query efficiency of index is much higher than B-Tree Indexes .
Hash Indexing disadvantages : What about imprecise search , Is also evident , because hash The algorithm is based on equivalent calculation , So for “like” Equal range search hash Invalid index , I won't support it ;
Memory Type of storage engine is mainly used for code tables whose content changes infrequently , Or as an intermediate result table for statistical operations , It is convenient to analyze the intermediate results efficiently and get the final statistical results ,. For the storage engine memory Be careful when updating tables , Because the data is not actually written to disk , So we must consider how to get the modified data after the next service restart .
(4)MERGE Storage engine
Merge The storage engine is a set of MyISAM Combination of tables , these MyISAM Tables must be exactly the same structure ,merge The table itself has no data , Yes merge Types of tables can be queried , to update , Delete operation , These operations are actually internal MyISAM Table .
边栏推荐
- 毕业三年的25岁码农总结
- How to make two objects or arrays equal
- Chrome浏览器的基本使用
- Typescript -- Section 5: classes
- Three PWN questions
- MSYQL is abnormal. Don't worry. Mr. Allen will point out the puzzle
- Leetcode 178 Score ranking (June 27, 2022)
- [buuctf.reverse] 131-135
- ES6模块
- [C Primer Plus Chapter II after class programming questions]
猜你喜欢
随机推荐
Along with the notes: methods simulating array like classes
剑指 Offer 12. 矩阵中的路径
MapReduce案例
Stm32f407-------- NVIC interrupt priority management
stm32F407-------LCD
Stm32f407------- external interrupt
stm32F407-------跑马灯、蜂鸣器
每日一题:消失的数字
这玩意叫跳表?
请问指南针股票软件可靠吗?在上面交易股票安全吗?
With notes: re understanding else if
Online yaml to JSON tool
LinkedIn datahub - experience sharing
Test experience: how testers evolve from 0 to 1
每日一题:移除元素
JVM工作原理介绍
The secondary market is full of bad news. How should the market go next? One article will show you the general trend
Differences among VaR, let and Const
力扣(LeetCode)178. 分数排名(2022.06.27)
SQL note 2 [MySQL]







