当前位置:网站首页>MySQL storage engine
MySQL storage engine
2022-07-23 11:55:00 【Summer invasion bug planning】
MySQL Storage engine
List of articles
Database storage engine is the underlying software component of database , Database management system uses data engine to create 、 Inquire about 、 Update and delete data operations . Different storage engines provide different storage mechanisms 、 Indexing techniques 、 Lock level and other functions , Specific functions can also be obtained by using different storage engines .
The name storage engine is only used in mysql in .(Oracle There is a corresponding mechanism in , But it's not called a storage engine .Oracle There is no special name in , Namely “ How tables are stored ”), Different table bottom organization methods ,mysql The default storage engine is InnoDB The way .( The default character set is UTF8)
Complete table building statement
CREATE TABLEt_x(idint(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;Be careful : stay MySQL among , Floating signs can be used for all identifiers (`xxx`) The enclosed . Better not use , Not universal . When creating a table, you can specify the storage engine , You can also specify a character set . The name storage engine is only used in mysql in .(Oracle There is a corresponding mechanism in , But it's not called a storage engine .Oracle There is no special name in , Namely “ How tables are stored ”)
// View the current mysql Supported storage engines
show engines;
MySQL5.7 Supported storage engines 
Common storage engines
MyISAM Storage engine
• The tables it manages have the following characteristics :
Use three files to represent each table :
Format file — Definition of storage table structure (xxxxx.frm)
Data files — Store the contents of table rows (xxxxx.MYD)
Index file — Store indexes on tables (xxxxxx.MYI)
– agile AUTO_INCREMENT Field handling
– advantage : Can be compressed , Save storage space . And can be converted to a read-only table , Improve retrieval efficiency .
shortcoming : Unsupported transaction .InnoDB Storage engine
• InnoDB The storage engine is MySQL The default engine .
• The tables it manages have the following main characteristics :
Every InnoDB The table is in the database directory as .frm The format file represents
InnoDB Table space tablespace Used to store the contents of a table
Provides a set of log files used to record transactional activities
use COMMIT( Submit )、SAVEPOINT And ROLLBACK( Roll back ) Support transaction processing
Provide full ACID compatible
stay MySQL Provide automatic recovery after server crash
Many versions (MVCC) And row level locking
Support the integrity of foreign keys and references , Including cascading deletion and update
advantage : Support transactions 、 Row-level locks 、 Foreign keys, etc . The security of this storage engine data is guaranteed .
The structure of the table is stored in xxx.frm In file
The data is stored in tablespace In such a table space ( The concept of logic ), Can't be compressed , Cannot convert to read-only .MEMORY Storage engine
• Use MEMORY The table that stores the engine , Its data is stored in memory , And the length of the line is fixed , These two characteristics make MEMORY The storage engine is very fast .
• MEMORY The tables managed by the storage engine have the following characteristics :
– In the database directory , Each table is marked with .frm Format file representation .
– Table data and indexes are stored in memory .
– Table level locking mechanism .
– Can not contain TEXT or BLOB Field .
MEMORY The storage engine was formerly known as HEAP engine .
| function | MyISAM | MEMORY | InnoDB |
|---|---|---|---|
| Storage limits | 256TB | RAM | 64TB |
| Support transactions | NO | NO | YES |
| Full text index support | YES | NO | NO |
| Tree index is supported | YES | YES | YES |
| Support hash index | NO | YES | NO |
| Support for data caching | NO | NO | YES |
| Support foreign keys | NO | NO | YES |
• MyISAM Table is most suitable for the mixed operation of reading a large amount of data and updating a small amount of data .MyISAM Another use case for tables is to use compressed read-only tables .
• If the query contains more data, the update operation , You should use InnoDB. Its row level locking mechanism and multi version support provide a good concurrency mechanism for the mixed operation of data reading and updating .
• You can use MEMORY Storage engine to store non permanent data , Or data that can be regenerated from disk based tables . Tips : Which engine to use should be selected flexibly according to the needs , Multiple tables in a database can use different engines to meet various performance and practical requirements . Using the right storage engine will improve the performance of the entire database .
边栏推荐
- Scala之一变量和数据类型
- NFT digital collection system development: Shenzhen Evening News "good times travel" digital collection online seconds chime
- Ten year structure five year Life-02 first job
- NFT digital collection system development, development trend of Digital Collections
- 数仓4.0笔记——数仓环境搭建—— Yarn配置
- Websocket long connection
- 修改mysql的root密码
- 2. MySQL data management - DML (add, modify, delete data)
- Implementation of neural network for face recognition
- Unable to negotiate with port 51732: no matching host key type found. Their offer:
猜你喜欢

Websocket long connection

APP自动化测试工具-appium的安装及使用

数仓4.0笔记——数仓环境搭建—— Yarn配置

Quartz2.2 simple scheduling job

NFT trading platform digital collection system | development and customization

数仓4.0笔记——用户行为数据采集二
![[system problems] Net Framework 3.5 installation error](/img/a1/f5410e954b607d5c0549051bd68aa1.png)
[system problems] Net Framework 3.5 installation error

数仓4.0笔记——业务数据采集——Sqoop

Machine learning algorithm for large factory interview (5) recommendation system algorithm

9、 Practical class
随机推荐
Implementation of neural network for face recognition
Data warehouse 4.0 notes - business data collection
uni原生插件开发--友盟一键登录
Stage 1 Review
11、多线程
Window runs gradle build ----- stacktrace. Exception occurs when the file framework-4.3.0.build-snapshot-schema.zip is not found
Object类
Typescript advanced type
APP审核期间遇到的问题总结
數倉4.0筆記——業務數據采集
第一阶段复习
Scala之二流程控制
MySQL索引
[hudi]hudi compilation and simple use of Hudi & spark and Hudi & Flink
[untitled]
1、MySQL初体验
Entrepôt de données 4.0 Notes - acquisition de données commerciales
shell取某一时间范围内月份
Data warehouse 4.0 notes - user behavior data generation
数仓4.0笔记——用户行为数据采集三