MySQL storage engine support

Reference: C language Chinese network

Storage Engine:

Database storage engine is the underlying software component database, a database management system using the data engine to create, query, update, and delete data operations.

Different storage engines provide different storage mechanism, indexing techniques, lock level and other functions, the use of different storage engines can also get specific function.

NOTE: The preferred engine InnoDB transactional databases, supports transaction-safe tables (ACID), supports row locking and foreign keys. After MySQL 5.5.5, InnoDB as the default storage engine.

MySQL v5.7 supports storage engine:

Displays the available database engine and default engine statement:

mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

Support column indicates whether the value of some engines can use, YEScould use it, NOthat they can not use, DEFAULTindicating that the engine is currently the default storage engine.

Transactions column indicates whether the value of support services, Yes expressed support, NO not supported.

 

In MySQL, you need to use the same server throughout the storage engine, for specific requirements, may use different storage engine for each table.

Several major engine of difference:

Features MylSAM MEMORY InnoDB Archive
Storage Limits 256TB RAM 64TB None
Support Services No No Yes No
Support for full-text indexing Yes No No No
Support tree index Yes Yes Yes No
Support hash indexes No Yes No No
It supports data caching No N/A Yes No
Support foreign keys No No Yes No

 

 

 

 

 

 

 

 

 MySQL storage engine can be selected according to the following principles:

  • If you want to provide commit, rollback and recovery of transaction-safe (ACID compliant) capabilities, and requirements to achieve concurrency control, InnoDB is a good choice.
  • If a data table queries primarily for inserting and recording, the MyISAM engine provides a higher processing efficiency.
  • If only temporarily stored data, the amount of data, and does not require high data security, you can choose the data stored in the memory MEMORY engines, MySQL use the engine as a temporary table to store intermediate results of the query.
  • If only INSERT and SELECT operations, you can choose Archive engine, Archive storage engine to support high concurrent insert operation, but the transaction itself is not safe. Archive storage engine is adapted to store archival data, logging information may be used as Archive Engine.

 

Guess you like

Origin www.cnblogs.com/pawn-i/p/12622312.html