理解mysql的儲存引擎
Summary: in this tutorial, you will learn various MySQL table types, or storage engines. It is essential to understand the features of each table type in MySQL so that you can use them effectively to maximize the performance of your databases.
MySQL provides various storage engines for its tables as below:
MyISAM
InnoDB
MERGE
MEMORY (HEAP)
ARCHIVE
CSV
FEDERATED
Each storage engine has its own advantages and disadvantages. It is crucial to understand each storage engine features and choose the most appropriate one for your tables to maximize the performance of the database. In the following sections we will discuss about each storage engine and its features so that you can decide which one to use.
MyISAM
MyISAM extends the former ISAM storage engine. The MyISAM tables are optimized for compression an speed. MyISAM tables are also portable between platforms and OSes.
The size of MyISAM table can be up to 256TB, which is huge. In addition, MyISAM tables can be compressed into read-only tables to save space. At startup, MySQL checks MyISAM tables for corruption and even repair them in case of errors. The MyISAM tables are not transaction-safe.
Before MySQL version 5.5, MyISAM is the default storage engine when you create a table without explicitly specify the storage engine. From version 5.5, MySQL uses InnoDB as the default storage engine.
InnoDB
The InnoDB tables fully support ACID-compliant and transactions. They are also very optimal for performance. InnoDB table supports foreign keys, commit, rollback, roll-and forward operations. The size of the InnoDB table can be up to 64TB.
Like MyISAM, the InnoDB tables are portable between different platforms and OSes. MySQL also checks and repair InnoDB tables, if necessary, at startup.
MERGE
A MERGE table is a virtual table that combines multiple MyISAM tables, which has similar structure, into one table. The MERGE storage engine is also known as the MRG_MyISAM engine. The MERGE table does not have its own indexes; it uses indexes of the component tables instead.
Using MERGE table, you can speed up performance in joining multiple tables. MySQL only allows you to perform , , and operations on the MERGE tables. If you use on a MERGE table, only MERGE specification is removed. The underlying tables will not be affected.
Memory
The memory tables are stored in memory and used hash indexes so that they are faster than MyISAM tables. The lifetime of the data of the memory tables depends on the up time of the database server. The memory storage engine is formerly known as HEAP.
Archive
The archive storage engine allows you to store a large number of records, which for archiving purpose, into a compressed format to save disk space. The archive storage engine compresses a record when it is inserted and decompress it using zlib library as it is read.
The archive tables only allow INSERT and SELECT commands. The archive tables do not support indexes, so reading records requires a full table scanning.
CSV
The CSV storage engine stores data in comma-separated values file format. A CSV table brings a convenient way to migrate data into non-SQL applications such as spreadsheet software.
CSV table does not support NULL data type and read operation requires a full table scan.
FEDERATED
The FEDERATED storage engine allows you to manage data from a remote MySQL server without using cluster or replication technology. The local federated table stores no data. When you query data from a local federated table, the data is pull automatically from the remote federated tables.
Choosing MySQL Table Types
You can download the following checklist to choose the most appropriate storage engine, or table type, based on various criteria.
MySQL Storage Engine Feature Summary (109.25 kB) 6754 downloads
In this tutorial, we’ve discussed about various MySQL storage engines available in MySQL.
原文連結:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/430/viewspace-2806113/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 儲存引擎MySql儲存引擎
- MySQL儲存引擎MySql儲存引擎
- MySQL系列-儲存引擎MySql儲存引擎
- MySQL InnoDB儲存引擎MySql儲存引擎
- MySQL-05.儲存引擎MySql儲存引擎
- MySQL入門--儲存引擎MySql儲存引擎
- MySQL之四 儲存引擎MySql儲存引擎
- 如何選擇mysql的儲存引擎MySql儲存引擎
- 聊一聊MySQL的儲存引擎MySql儲存引擎
- MySQL InnoDB 儲存引擎探祕MySql儲存引擎
- 2_mysql(索引、儲存引擎)MySql索引儲存引擎
- MySQL federated儲存引擎測試MySql儲存引擎
- 怎麼檢視mysql的儲存引擎MySql儲存引擎
- 小談mysql儲存引擎優化MySql儲存引擎優化
- MySQL儲存引擎入門介紹MySql儲存引擎
- MySQL資料庫操作、儲存引擎MySql資料庫儲存引擎
- MySQL索引、事務與儲存引擎MySql索引儲存引擎
- 簡單認識MySQL儲存引擎MySql儲存引擎
- 【MySQL】MySQL(四)儲存引擎、索引、鎖、叢集MySql儲存引擎索引
- MySQL儲存引擎:MyISAM和InnoDB的區別MySql儲存引擎
- MySQL儲存引擎--MyISAM與InnoDB區別MySql儲存引擎
- MySQL資料庫儲存引擎簡介MySql資料庫儲存引擎
- Mysql之儲存引擎及字符集MySql儲存引擎
- 《MySQL 效能優化》之 InnoDB 儲存引擎MySql優化儲存引擎
- [Mysql技術內幕]Innodb儲存引擎MySql儲存引擎
- MySQL體系結構與儲存引擎MySql儲存引擎
- MySQL InnoDB儲存引擎體系結構MySql儲存引擎
- 儲存引擎儲存引擎
- MySQL的nnodb引擎表資料分割槽儲存MySql
- 說說自己對於 MySQL 常見的兩種儲存引擎:MyISAM與 InnoDB的理解MySql儲存引擎
- 重新學習Mysql資料庫3:Mysql儲存引擎與資料儲存原理MySql資料庫儲存引擎
- mysql dba系統學習(20)mysql儲存引擎MyISAMMySql儲存引擎
- 談談MySQL InnoDB儲存引擎事務的ACID特性MySql儲存引擎
- bitcask儲存引擎儲存引擎
- MySQL不同儲存引擎的資料備份與恢復MySql儲存引擎
- MySQL儲存引擎簡介及MyISAM和InnoDB的區別MySql儲存引擎
- MySQL中InnoDB儲存引擎的實現和執行原理MySql儲存引擎
- 十八、Mysql儲存引擎並不只有MyISAM、InnoDB——精髓MySql儲存引擎