当前位置:网站首页>Database composition storage engine
Database composition storage engine
2022-07-26 11:33:00 【Hua Weiyun】
3.2 MySQL Storage engine
Storage engine in MySQL The bottom layer is provided in the form of components , Storage mechanisms provided by different storage engines 、 The storage mode of the index is different from the lock granularity . This section is right MySQL A brief introduction to the commonly used storage engines in .
3.2.1 see MySQL Storage engine in
Can be in MySQL Enter the following command on the command line , View the current MySQL Supported storage engines .
mysql> SHOW ENGINES \G*************************** 1. row *************************** Engine: ARCHIVE Support: YES Comment: Archive storage engineTransactions: NO XA: NO Savepoints: NO*************************** 2. row *************************** Engine: BLACKHOLE Support: YES Comment: /dev/null storage engine (anything you write to it disappears)Transactions: NO XA: NO Savepoints: NO*************************** 3. row *************************** Engine: MRG_MYISAM Support: YES Comment: Collection of identical MyISAM tablesTransactions: NO XA: NO Savepoints: NO*************************** 4. row *************************** Engine: FEDERATED Support: NO Comment: Federated MySQL storage engineTransactions: NULL XA: NULL Savepoints: NULL*************************** 5. row *************************** Engine: MyISAM Support: YES Comment: MyISAM storage engineTransactions: NO XA: NO Savepoints: NO*************************** 6. row *************************** Engine: PERFORMANCE_SCHEMA Support: YES Comment: Performance SchemaTransactions: NO XA: NO Savepoints: NO*************************** 7. row *************************** Engine: InnoDB Support: DEFAULT Comment: Supports transactions, row-level locking, and foreign keysTransactions: YES XA: YES Savepoints: YES*************************** 8. row *************************** Engine: MEMORY Support: YES Comment: Hash based, stored in memory, useful for temporary tablesTransactions: NO XA: NO Savepoints: NO*************************** 9. row *************************** Engine: CSV Support: YES Comment: CSV storage engineTransactions: NO XA: NO Savepoints: NO9 rows in set (0.00 sec)Results show , At present MySQL In all 9 Storage engine , except FEDERATED Outside the storage engine , And support 8 Storage engine .
Be careful : The author's MySQL Version is 8.0.18.
3.2.2 Common storage engine introduction
MySQL The storage engines commonly used in are InnoDB、MyISAM、MEMORY、ARCHIVE and CSV, This section gives a brief introduction to these storage engines .
1.InnoDB Storage engine
InnoDB The characteristics of the storage engine are as follows :
· Support transactions .
· The lock level is row lock , Than MyISAM The storage engine supports higher concurrency .
· Able to recover data through binary logs .
· Support foreign key operation .
· On index storage , The index and data are stored in the same file , The default in accordance with the B+Tree Organize the structure of the index . meanwhile , The leaf node of the primary key index stores complete data records , The leaf node of the non primary key index stores the value of the primary key .
· stay MySQL 5.6 After the version , By default InnoDB Storage engine .
· stay MySQL 5.6 After the version ,InnoDB The storage engine supports full-text indexing .
2.MyISAM Storage engine
MyISAM The characteristics of the storage engine are as follows :
· Unsupported transaction .
· The lock level is table lock , It is not applicable in scenarios requiring high concurrency .
· If the data file is damaged , Difficult to recover data .
· Foreign key not supported .
· On index storage , The index file is separated from the data file .
· Full text index support .
3.MEMORY Storage engine
MEMORY The characteristics of the storage engine are as follows :
· I won't support it TEXT and BLOB data type , Only fixed length string types are supported . for example , stay MEMORY In the storage engine , Will VARCHAR The type is automatically converted to CHAR type .
· The lock level is table lock , In high concurrency scenarios, it will become a bottleneck .
· It is usually used as a temporary table , Intermediate results are generated when storing query data .
· Data stored in memory , Data will be lost after restarting the server . If it is data that needs persistence , Not suitable for storage in MEMORY In the data table of the storage engine .
4.ARCHIVE Storage engine
ARCHIVE The characteristics of the storage engine are as follows :
· Support data compression , Before storing data, the data will be compressed , Suitable for storing archived data .
· Only data insertion and query are supported , After inserting data , Data cannot be changed or deleted , Only query .
· It only supports adding indexes to fields of integer auto increment type .
5.CSV Storage engine
CSV The characteristics of the storage engine are as follows :
· The main storage is .csv Formatted text data , You can directly open the stored file for editing .
· Can be MySQL The data in a data table in is directly exported as .csv file , Can also be .csv Import the file into the data table .
Be careful : The author just listed MySQL Some storage engines commonly used in , Knowledge of other storage engines , Readers can refer to MySQL Official documents for understanding and learning , Address the following :
https://dev.mysql.com/doc/refman/8.0/en/storage-engines.html
https://dev.mysql.com/doc/refman/8.0/en/innodb-storage-engine.html
边栏推荐
- MLX90640 红外热成像仪测温传感器模块开发笔记(六)
- swagger2.9.2教程 与swagger3.0.0教程
- easyui04
- FINEOS宣布2022年GroupTech Connect活动开放注册
- ESP8266-Arduino编程实例-开发环境搭建(基于PlatformIO)
- Leetcode-209. subarray with the smallest length (binary, prefix and, sliding window)
- 武林头条-建站小能手争霸赛
- MongoDB-使用$type查询某个字段的类型是否为xxx
- 数据库组成 触发器
- Getting started step by step using g2o to solve ICP problems - estimating the transformation relationship between two sets of 3D point sets with matching relationship
猜你喜欢
随机推荐
easyui02
easyui05
查询进阶 别名
MySQL数据库的简单使用
Query summary of SQL Server
由浅入深搭建神经网络
数据库组成索引和约束
Getting started step by step using g2o to solve ICP problems - estimating the transformation relationship between two sets of 3D point sets with matching relationship
After 4 months of job search and 15 interviews, I finally got 3 offers, ranking P7+
[development tool] ieda red
ESP8266-Arduino编程实例-开发环境搭建(基于PlatformIO)
Record errors encountered by individuals
新来个技术总监要我做一个 IP 属地功能~
PostgreSQL在Linux和Windows安装和入门基础教程
List ascending and descending
1837. Sum of digits under k-ary representation
安科瑞余压监控系统在住宅小区的应用方案
Access rights - private, public, protected
easyui01
MLX90640 红外热成像仪测温传感器模块开发笔记(六)







![[开发工具] IEDA报红](/img/2d/eec1f74c33ff21ae4951eae44b9369.png)
