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
introduce In a distributed system, distributed lo...
As a lightweight open source database, MySQL is w...
This should be something that many people have do...
Table of contents 【Code background】 【Code Impleme...
Preface The method of configuring IP addresses in...
Controversy over nofollow There was a dispute bet...
Table of contents Overview Object rest attribute ...
I won’t waste any more time talking nonsense, let...
Today I will introduce a very simple trick to con...
This article example shares the specific code of ...
Doccer Introduction: Docker is a container-relate...
Borrowing Constructors The basic idea of this t...
In order to extend the disk life for storing audi...
Volume Label, Property Name, Description 002 <...
This article shares the specific code of Vue.js t...