当前位置:网站首页>Yyds dry inventory comparison of several database storage engines
Yyds dry inventory comparison of several database storage engines
2022-07-06 02:32:00 【getupos】
Table of Contents
1. Mysql Introduction to storage engine
The concept of a storage engine is MySQL Characteristics , And it is a plug-in storage engine concept . To determine the MySQL Tables in the database can be saved in different ways . Users can use their own needs , Choose different storage methods 、 Whether to carry out entry processing, etc .
Use SHOW ENGINES Statement to view the engine types supported by the system
The main parameters in the results are introduced as follows .
Engine Parameters : Refers to the name of the storage engine .
Support Parameters : explain MySQL Whether this kind of engine is supported .
Comment Parameters : Refers to comments on the engine .
Transactions Parameters : Indicates whether transaction processing is supported ,YES Indicates that it can be used ,NO Indicates not available .
XA Parameters : Indicates whether distributed transaction processing XA standard ,YES Express support .
Savepoints Parameters : Indicates whether savepoints are supported , So that the transaction can be rolled back to the savepoint ,YES Express support .
From the query results, we can get ,MySQ1 The supported storage engines are InnoDB、MRG_MYISAM、MEMORY,PERFORMANCE SCHEMA、ARCHIVE、FEDERATED、CSV、BLACKHOLE、MyISAM, among InnoDB Is the default storage engine , Of this engine Support Parameter values for DEFAULT.
2. InnoDB Storage engine
InnoDB yes MySOL A storage engine for databases ,InnoDB to MySQL The data table provides transactions 、 Return to . Crash repair capabilities and multi version concurrent control of transaction security , Support row locking and foreign keys .MySQL The default storage engine for is InnoDB.InnoDB The main features are as follows :
(1)InnoDB to MySOL Provided with commit , Transaction security of rollback and crash recovery capability (ACID compatible ) Storage engine .InnoDB Locked at line level and also at SELECT Statement provides a similar Oracle Non locked reading . These capabilities add to multi-user deployment and performance . stay SOL Querying , Be free to InnoDB Type of table with other MySQL The types of the tables are mixed up , Even in the same query can be mixed .
(2)InnoDB It's designed for maximum performance when dealing with huge amounts of data . its CPU Efficiency may be unmatched by any other disk based relational database engine .
(3) InnoDB Support for foreign key integrity constraints (FOREIGN KEY). When storing data in a table , Each table is stored in primary key order , If the primary key is not explicitly specified in the table definition ,InnoDB A... Will be generated for each line 6 Bytes of ROWID, And use this as the primary key .
(4)InnoDB It is used in many large database sites that need high performance .InnoDB Do not create directory , Use InnoDB when ,MySQL Will be in MySQL Create a data directory named ibdatal Of 10MB Automatic extended data file size , And two named ib_logfile0 and ib_logfile1 Of 5MB The size of the log file .
3. MyISAM Storage engine
MyISAM The storage engine is MySQL Common storage engines in , Used to be MySQL The default storage engine for ,MyISAM The storage engine is based on ISAM The development of storage engine , And it adds many useful extensions , Such as having a high insertion 、 Query speed, etc , But it doesn't support transactions , The main features are :
(1) A large file ( reach 63 Bit file length ) Supported on file systems and operating systems that support large files .
(2) When you mix delete with update and insert , Dynamically sized rows are less fragmented . This is done by merging adjacent deleted blocks , And if the next block is deleted , Just expand to the next block to automatically complete .
(3) Every MyISAM The maximum number of indexes for a table is 64. This can be changed by recompiling . The maximum number of columns per index is 16.
(4) The maximum bond length is 1000 byte . This can also be changed by compiling . For keys longer than 250 Byte case , Use a more than 1024 Byte key block .
(5) BLOB and TEXT Columns can be indexed .
(6)NULL Value is allowed in the column of the index .
(7) All numeric key values are stored first in high byte bits to allow a higher index compression .
(8) One for each watch AUTO INCREMENT Internal processing of columns .MyISAM by INSERT and UPDATE Operation to automatically update this column . This makes AUTO INCREMENT The column is faster ( At least 10%). After the value at the top of the sequence is deleted, it cannot be reused .
(9) You can put data files and index files in different directories .
(10) Each character column can have a different character set .
(11) Yes VARCHAR Tables can have fixed or dynamic record lengths .
(12)VARCHAR and CHAR Columns can be up to 64KB.
Use MyISAM The engine creates the database , Will produce 3 File . The name of the file starts with the name of the table , Extension refers to
The extension of the index file is the file type :frm File storage table definition , The extension of the data file is .MYD (MYData)
4. MEMORY Storage engine
MEMORY The storage engine is MySQL A special kind of storage engine in , It uses content stored in memory to create , And all the data is in memory , These characteristics are related to InnoDB Storage engine 、MyISAM Storage engines are different .MEMORY The main features are as follows :
(1)MEMORY Tables can have as many as each table 32 An index , Every index 16 Column , as well as 500 The maximum key length of bytes .
(2)MEMORY Storage engine execution HASH and BTREE Indexes .(3) Can be in a MEMORY There are non unique keys in the table .
(4)MEMORY Table uses a fixed record length format .(5)MEMORY I won't support it BLOB or TEXT Column .
(6) MEMORY Support AUTO INCREMENT Columns and pairs can contain NULL Index of the column of the value .(7) MEMORY Tables are shared among all clients ( Like anything else TEMPORARY surface ).
(8) MEMORY Table contents are stored in memory , Memory is MEMORY The table is shared with the internal table created by the server during the idle time of query processing .
(9) When there is no need for MEMORY The content of the table , To release MEMORY Memory used by table , Should carry out DELETE FROM or TRUNCATE TABLE, Or delete the table as a whole ( Use DROP TABLE).
5. Choice of storage engine
Different storage engines have their own characteristics , Suitable for different needs , In order to make a choice , First of all, we need to consider what different functions each storage engine provides . surface 3-1 Is the function comparison of common storage engines .
InnoDB Storage engine : If a submission is to be provided 、 Transaction security of rollback and crash recovery capability (ACID compatible ) Ability , It also requires concurrent control ,InnoDB Storage engine is a good choice .
MyISAM Storage engine : If the data table is mainly used to insert and query records , be MyISAM The engine can provide high processing efficiency , therefore MyISAM Storage engine is the first choice .
MEMORY Storage engine : If it's just temporary data storage , Not a lot of data , And no need for high data security , You can choose to save the data in memory MEMORY engine ,MySQL Use in MEMORY The storage engine stores the intermediate results of the query as a temporary table .
ARCHIVE Storage engine : If only INSERT and SELECT operation , You can choose ARCHIVE engine ,ARCHIVE
The storage engine supports high concurrency insertion operations, but it has a large self-service, but it is not conservative .ARCHIVE Storage engines are great for storing archived data , For example, log information can be used ARCHIVE engine .
All in all , 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 actual needs , Use the right storage engine , It will be helpful to the performance of the whole database .
边栏推荐
- Global and Chinese markets of screw rotor pumps 2022-2028: Research Report on technology, participants, trends, market size and share
- 在GBase 8c数据库中使用自带工具检查健康状态时,需要注意什么?
- ReferenceError: primordials is not defined错误解决
- Large scale DDoS attacks take Myanmar offline
- Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
- Number conclusion LC skimming review - 1
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
- MySQL (IV) - transactions
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
- 【MySQL 15】Could not increase number of max_open_files to more than 10000 (request: 65535)
猜你喜欢
Sword finger offer 29 Print matrix clockwise
零基础自学STM32-复习篇2——使用结构体封装GPIO寄存器
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
vs code保存时 出现两次格式化
从顶会论文看2022年推荐系统序列建模的趋势
剑指 Offer 29. 顺时针打印矩阵
2022年版图解网络PDF
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
随机推荐
MySQL (IV) - transactions
sql表名作为参数传递
PAT甲级 1033 To Fill or Not to Fill
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
vs code保存时 出现两次格式化
HDU_ p1237_ Simple calculator_ stack
Thinking on Architecture Design (under continuous updating)
【无标题】数据库中一条查询SQL执行的过程
Accident index statistics
550 permission denied occurs when FTP uploads files, which is not a user permission problem
零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO
After changing the GCC version, make[1] appears in the compilation: cc: command not found
【机器人手眼标定】eye in hand
【社区人物志】专访马龙伟:轮子不好用,那就自己造!
好用的 JS 脚本
[coppeliasim] 6-DOF path planning
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
Global and Chinese markets for single beam side scan sonar 2022-2028: Research Report on technology, participants, trends, market size and share
【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)