当前位置:网站首页>数据存储:MySQL之InnoDB与MyISAM的区别
数据存储:MySQL之InnoDB与MyISAM的区别
2022-06-26 05:17:00 【青铜大神】
存储方面
InnoDB用frm文件存储表的定义、ibd存放数据和索引。
Mysql8.0之前:
MyISAM用3个文件来存储数据,frm文件存储表的定义、MYD文件存放数据、MYI文件存放索引。
Mysql8.0:
MySQL8开始删除了原来的frm文件,并采用 Serialized Dictionary Information (SDI), 是MySQL8.0重新设计数据词典后引入的新产物,并开始已经统一使用InnoDB存储引擎来存储表的元数据信息。SDI信息源记录保存在ibd文件中。SDI以JSON格式存储
MyISAM用sdi存储表的定义、MYD文件存放数据、MYI文件存放索引。
功能方面
1.InnoDB支持事务,MyISAM不支持。因为MyISAM不支持事务,比其安全的事务操作MyISAM更强调性能,所以查询效率会比InnoDB更高。
2.InnoDB支持外键,MyISAM不支持。一个包含外键的InnoDB转MyISAM会失败。
3.InnoDB是聚簇索引,MyISAM是非聚簇索引。InnoDB的主键索引是聚簇索引,InnoDB是必须要有主键的。
如果在创建表时没有显式地定义主键,则InnoDB存储引擎会按如下方式选择或创建主键:
1 首先判断表中是否有非空的唯一索引,如果有,则该列即为主键
2 如果不符合上述条件,InnoDB存储引擎自动创建一个6字节大小的主键(用户不可见)
4.InnoDB不保存表的具体行数,执行 select count(*) from table 时需要全表扫描。MyISAM用一个变量保存了整个表的记录数,查询的时候只需要取出来,速度很快。
5.InnoDB支持表级锁与行级锁,而MyISAM只支持表级锁。
边栏推荐
- How to ensure the efficiency and real-time of pushing large-scale group messages in mobile IM?
- RESNET practice in tensorflow
- How to make your big file upload stable and fast?
- Douban top250
- data = self._ data_ queue. get(timeout=timeout)
- cartographer_backend_constraint
- A beginner's entry is enough: develop mobile IM from zero
- [greedy college] recommended system engineer training plan
- Muke.com actual combat course
- apktool 工具使用文档
猜你喜欢
How does P2P technology reduce the bandwidth of live video by 75%?
86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
《财富自由之路》读书之一点体会
apktool 工具使用文档
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
A beginner's entry is enough: develop mobile IM from zero
Serious hazard warning! Log4j execution vulnerability is exposed!
[unity3d] rigid body component
Status of processes and communication between processes
C# 39. string类型和byte[]类型相互转换(实测)
随机推荐
瀚高数据库自定义操作符‘!~~‘
PHP之一句话木马
ThreadPoolExecutor implements file uploading and batch inserting data
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
vscode config
2021年OWASP-TOP10
Mysql 源码阅读(二)登录连接调试
The first gift of the project, the flying oar contract!
线程优先级
Transport layer TCP protocol and UDP protocol
Sentimentin tensorflow_ analysis_ cell
Happy New Year!
Henkel database custom operator '~~‘
Protocol selection of mobile IM system: UDP or TCP?
As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
How to make your big file upload stable and fast?
First day of deep learning and tensorflow learning
-Discrete Mathematics - Analysis of final exercises
Recursively traverse directory structure and tree presentation
Lstms in tensorflow_ Cell actual combat