当前位置:网站首页>数据存储: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只支持表级锁。
边栏推荐
- Install the tp6.0 framework under windows, picture and text. Thinkphp6.0 installation tutorial
- 基于SDN的DDoS攻击缓解
- RESNET in tensorflow_ Train actual combat
- Schematic diagram of UWB ultra high precision positioning system
- The localstorage browser stores locally to limit the number of forms submitted when tourists do not log in.
- 两步处理字符串正则匹配得到JSON列表
- The wechat team disclosed that the wechat interface is stuck with a super bug "15..." The context of
- Zuul 实现动态路由
- apktool 工具使用文档
- 国务院发文,完善身份认证、电子印章等应用,加强数字政府建设
猜你喜欢

A company crawling out of its grave
![[red team] what preparations should be made to join the red team?](/img/03/f246f18f8925167dbd5e9d63912faa.png)
[red team] what preparations should be made to join the red team?

LeetCode 19. Delete the penultimate node of the linked list

The first gift of the project, the flying oar contract!

The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!

PHP 2D / multidimensional arrays are sorted in ascending and descending order according to the specified key values

cartographer_optimization_problem_2d

Tensorflow and deep learning day 3

cartographer_pose_graph_2d

6.1 - 6.2 Introduction à la cryptographie à clé publique
随机推荐
Guanghetong and anti international bring 5g R16 powerful performance to the AI edge computing platform based on NVIDIA Jetson Xavier nx
第九章 设置结构化日志记录(一)
Ad tutorial series | 4 - creating an integration library file
Muke.com actual combat course
C# 40. Byte[] to hexadecimal string
红队得分方法统计
【Unity3D】人机交互Input
[unity3d] rigid body component
C# 39. Conversion between string type and byte[] type (actual measurement)
Collections and dictionaries
cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配
Setting pseudo static under fastadmin Apache
Thoughts triggered by the fact that app applications are installed on mobile phones and do not display icons
One of token passing between microservices @feign's token passing
Final review of brain and cognitive science
vscode config
6.1 - 6.2 公鑰密碼學簡介
The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
Two step processing of string regular matching to get JSON list
Experience of reading the road to wealth and freedom