当前位置:网站首页>MySQL storage engine and its differences
MySQL storage engine and its differences
2022-07-27 05:01:00 【Meme_ xp】
MySQL 5.7 The supported storage engines are InnoDB、MyISAM、Memory、Merge、Archive、Federated、CSV、BLACKHOLE etc. .
have access to SHOW ENGINES Statement to view the engine types supported by the system , The result is shown in the figure .

difference
1.myisam Is the default table type and is not transaction safe ;innodb Support transactions .
2.myisam Foreign key not supported ;Innodb Support foreign keys .
3.myisam Support table level lock ( High concurrency is not supported , Mainly reading );innodb Support row lock ( Shared lock , Exclusive lock , Intent locks ), Smaller particle size , But when performing a scan that cannot determine the scope sql When the sentence is ,innodb It will also lock the whole watch .
4. Execute a lot of select,myisam Is the best choice ; Perform a lot of update and insert It is best to innodb.
5.myisam There are three files stored on disk .frm( Storage table definition ) .myd( Store table data ) .myi( Storage table index );innodb What is stored on disk are tablespace data files and log files ,innodb The size of the table is limited only by the size of the operating system .
6.myisam Use nonclustered indexes , Index and data are separated , Cache index only ;innodb Using a clustered index , Index and data exist in a file .
7.myisam Save the specific number of rows in the table ;innodb Do not save .
8.delete from table when ,innodb Will not re resume , It will be deleted line by line .
myisam

Index by B+ Trees make up , When executing the query operation, you will first search B+ Trees , If the corresponding leaf node is found, it will , According to the value of leaf node ( Address ), Take out the whole row of data .
innodb

Above, InnoDB Main index ( It's also a data file ) Schematic diagram , You can see that the leaf node contains the complete data record . This kind of index is called clustered index . because InnoDB The data files themselves should be aggregated by primary key , therefore InnoDB Table must have primary key (MyISAM There can be no ), If not explicitly specified , be MySQL The system will automatically select a column that can uniquely identify the data record as the primary key , If there is no such column , be MySQL Automatically for InnoDB Table generates an implicit field as the primary key , The length of this field is 6 Bytes , The type is long plastic .

It's in English ASCII Code as a comparison criterion . The implementation of clustered index makes the search by primary key very efficient , But the secondary index search needs to retrieve the index twice : First retrieve the secondary index to get the primary key , Then use the primary key to retrieve the record in the primary index .
边栏推荐
- 事件过滤器
- [error reporting]: cannot read properties of undefined (reading 'prototype')
- 数字中国建设峰会闭幕,现场海量图片一览!
- Digital integrated circuit: MOS tube device chapter (I)
- js小技巧
- Comprehensive experiment of static routing
- ps太卡怎么办?几步帮您解决问题
- 如何将Photoshop图层复制到其他文档
- Digital integrated circuit: MOS tube device chapter (II)
- Cache read / write policies: cacheside, read/writethrough and writeback policies
猜你喜欢

标准对话框 QMessageBox

"Photoshop2021 introductory tutorial" flatten "perspective images

STM32 Hal serial port (uart/usart) debugging experience (I) -- basic knowledge of serial port communication +hal library code understanding

JS day 2 (variables, variable usage, naming rules, syntax extensions)

Photoshop裁剪工具隐藏技巧

SVN使用详解

小程序项目如何创建

What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?

How does PS import LUT presets? Photoshop import LUT color preset tutorial

在有序数组找具体某个数字
随机推荐
标准对话框 QMessageBox
Be diligent in talking about what sidelines you can do now
Bubble sort (detailed)
二叉搜索树详讲
Easily download data in power Bi reports with power auto
[error reporting]: cannot read properties of undefined (reading 'prototype')
2022 T2i text generated image Chinese Journal Paper quick view-1 (ecagan: text generated image method based on channel attention mechanism +cae-gan: text generated image technology based on transforme
【牛客讨论区】第七章:构建安全高效的企业服务
strlen和sizeof的区别
[error reporting] cannot read property 'parsecomponent' of undefined
What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?
自定义视口高度,多余的部分使用滚动
js小技巧
HCIA dynamic routing OSPF experiment
Stm32 cubemx hal----- PWM - change frequency
【Acwing】第61场周赛 题解
There is no need to install CUDA and cudnn manually. You can install tensorflow GPU through a one-line program. Take tensorflow gpu2.0.0, cuda10.0, cudnn7.6.5 as examples
Dynamic routing configuration
Affine transformation module and conditional batch Standardization (CBN) of detailed text generated images
Why is select not recommended*