当前位置:网站首页>The difference between MySQL's InnoDB and MyISAM
The difference between MySQL's InnoDB and MyISAM
2022-08-05 12:00:00 【Ziye cotyledon】
The MyISAM engine was used by default before MySQL 5.5, and the InnoDB engine was used by default after 5.5.
The difference:
- Transactions and foreign keys
InnoDB supports transactions and foreign keys, with security and integrity, suitable for a large number of insert and update operations.
MyISAM does not support transactions and foreign keys, it provides high-speed storage and retrieval, suitable for a large number of select query operations.
- Locking mechanism
InnoDB supports row-level locks to lock specified records.Locking is implemented based on the index.
MyISAM supports table-level locks, locking the entire table.
The two directly affect the efficiency of concurrency in terms of locking mechanism.
- Index structure
InnoDB uses a clustered index (clustered index), the index and records are stored together -> both the index and the records are cached.
MyISAM uses a clustered index (non-clustered index), the index and records are separate.
- Concurrency processing ability
InnoDB read and write blocking is related to the isolation level. Multi-version concurrency control (MVCC) can be used to support high concurrency.
MyISAM uses table locks, which will be exclusive, resulting in a low concurrency rate of write operations, and will not block read and write blocking between reads.
- Storage files
The InnoDB table corresponds to two files, one ==.frmtable structure file and one .ibddata file.The standard can store up to 64TB.
MyISAM table corresponds to three files, one .frm table structure file, one .MYD table data file, and one .MYI== index file.As of 5.0, tables can store up to 256TB. - Applicable scenarios
InnoDB
- Requires transaction support (has better transaction features)
- Row-level locking is well-adapted to high concurrency
- Scenarios with frequent data updates
- Higher data consistency requirements
- The memory of the hardware device is large, and the better cache capacity of InnoDB can be used to improve memory utilization and reduce disk IO
MyISAM
- Transaction support is not required (not supported)
- relatively low concurrency (locking mechanism problem ->table lock)
- Data modification is relatively small, mainly read
- Data consistency requirements are not high
Summary->How to choose between two engines?
- Are transactions required?Required, InnoDB
- Are there concurrent modifications? Yes, InnoDB
- Are you pursuing higher query speed with less data modification?Yes, MyISAM
InnoDB is recommended
Other chapters ->Jump
end...边栏推荐
猜你喜欢

Shang Silicon Valley-JUC

训练集Loss收敛,但是测试集Loss震荡的厉害?
Shang Silicon Valley-JVM-Performance Monitoring and Tuning (P302~P381)

CC2530实现按键中断

软件设计七大原则之开闭原则(Open-Closed Principle, OCP)

详细剖析 Redis 三种集群策略

【HMS core】【FAQ】Health Kit、Ads kit、push Kit典型问题合集5
![[供应链·案例篇]疫情影响下的全球十大零售商都做了些什么](/img/44/9ef9f86f8afb85f49aac1cce55723d.jpg)
[供应链·案例篇]疫情影响下的全球十大零售商都做了些什么
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?

PMP每日一练 | 考试不迷路-8.5(包含敏捷+多选)
随机推荐
Mysql8基础知识
2022.08.01_每日一题
分布式事务解决方案
2022 CCF International AIOps Challenge Finals and AIOps Seminar Registration Open
2022.08.03_每日一题
基于NSQ搭建高可用分布式消息队列
详细剖析 Redis 三种集群策略
Opening today: LiveVideoStackCon 2022 Audio and Video Technology Conference Shanghai Station
[Supply Chain·Case] What did the top ten retailers in the world do under the influence of the epidemic?
The importance of parameter naming, remember a JDBC parameter conflict
2022.08.02_Daily question
2022.08.02_每日一题
C语言例题-打印日历
Memory problems difficult to locate, it is because you do not use ASAN
后缀自动机(SAM)——黑盒使用方案
尚硅谷-JVM-内存和垃圾回收篇(P1~P203)
hello world、hello 计科人
常用的免费Api接口网址
Go 语言快速入门指南: 基本类型
2022.08.01 _ a day