Introduction to four commonly used MySQL engines (1): MyISAM storage engine: It does not support transactions or foreign keys. Its advantage is fast access speed. Applications that do not require transaction integrity or are mainly select and insert can basically use this engine to create tables. Supports 3 different storage formats: static table; dynamic table; compressed table Static table: The fields in the table are all non-variable length fields, so each record is of fixed length. The advantages are very fast storage, easy caching, and easy recovery in case of failure. The disadvantage is that it usually takes up more space than a dynamic table (because the spaces are filled according to the column width definition during storage). PS: When retrieving data, the spaces after the fields will be removed by default. If you are not careful, the spaces in the data itself will also be ignored. Dynamic table: The record length is not fixed. The advantage of this storage is that it takes up relatively less space. Disadvantage: Frequent updates and deletions of data can easily cause fragmentation. You need to regularly execute the OPTIMIZE TABLE or myisamchk -r command to improve performance. Compressed tables: Because each record is compressed individually, there is very little access overhead. (2) InnoDB storage engine* The storage engine provides transaction safety with commit, rollback, and crash recovery capabilities. However, compared to the MyISAM engine, the write processing efficiency is lower and it will take up more disk space to retain data and indexes. (3): MEMORY storage engine The Memory storage engine creates tables using content that exists in memory. Each memory table actually corresponds to only one disk file, and the format is .frm. Memory type tables are very fast to access because their data is stored in memory and uses HASH index by default, but once the service is shut down, the data in the table will be lost. Hash index advantages: The Memory type storage engine is mainly used for code tables whose contents do not change frequently, or as intermediate result tables for statistical operations, so as to efficiently analyze the intermediate results and obtain the final statistical results. Be cautious when updating tables whose storage engine is memory, because the data is not actually written to the disk, so you must consider how to obtain the modified data after the next restart of the service. (4) MERGE storage engine The Merge storage engine is a combination of a group of MyISAM tables. These MyISAM tables must have exactly the same structure. The merge table itself does not have data. The merge type table can be queried, updated, and deleted. These operations are actually performed on the internal MyISAM table. The above is a detailed explanation and integration of the four commonly used storage engines in MySQL introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: linux No space left on device 500 error caused by inode fullness
>>: Teach you how to implement a react from html
Loading rules of require method Prioritize loadin...
Dark background style page design is very popular...
A certain distance can be set between cells in a ...
Summarize Global environment ➡️ window Normal fun...
Table of contents 1. Primary key exists 2. No pri...
1. [admin@JD ~]$ cd opt #Enter opt in the root di...
If your MySQL database is installed on a centos7 ...
In the previous article, I introduced the detaile...
This article example shares the specific code of ...
1. What is semanticization? Explanation of Bing D...
1. Introduction By enabling the slow query log, M...
Written in front: Sometimes you may need to view ...
Copy code The code is as follows: <!DOCTYPE ht...
Alibaba Cloud Server cannot connect to FTP FileZi...
Preface It is very simple to create a server in n...