The mysql database storage engine

                                                            mysql storage engine Overview                                                

What is the storage engine?                                                              

MYSQL data with the different technologies stored in the file (or memory), these techniques each technology uses a different storage mechanism, indexing techniques, lock level and ultimately provide a wide range of different functions and capabilities. by choosing different techniques, you dog can get extra speed or functionality, thereby improving the overall functionality of your application.

Memory storage engine can be stored in memory all the tabular data, or you need a support transaction processing database (to ensure that transaction processing is unsuccessful rollback capability data), and these different technologies and supporting related functions and mysql is called storage engine (also called table type).

MYSQL storage engine is different from other database management systems are the most prominent feature, such as his brother in Oracle there is no concept of special storage engine, just have to distinguish between OLTP and OLAP mode, on different parameters.

We know that there is a data table table, we can be understood as the table rows and columns, each table is a data, said in data storage, but also to organize data storage structure, organizational structure is to have these data storage the role of the decision engine that provides storage engine is stored in the data storage structure

In simple terms: storage engine is stored in the data structure, there is a practical business decision.

What storage engine mysql support?                                               

mysql support storage engines include: 
the FEDERATED 
MRG_MYISAM 
MYISAM 
BLACKHOLE 
CSV 
the MEMORY 
the ARCHIVE 
InnoDB 
PERFORMANCE_SCHEMA 

which InnoDB provides transaction-safe tables, other storage engines are non-transaction-safe tables
Storage Engine

                                                         Characteristics of various storage engines                                                  

The two most common storage engine is MYISAM and InnoDB

The FEDERATED 
Federated storage engine does not store data, providing the ability to connect different mysql servers from multiple physical machines to create a logical database, similar to the oracle transparent gateway for distributed data or market scenes. 

MYISAM 

MYISAM official default is mysql the storage engine, which is characterized not support transactions, foreign keys, operating speed, access speed, but the table level lock limits its performance in terms of read and write load, so it is often applied to read-only or read-based data scene Note: Do not cache data files, cache only the index file 

bLACKHOLE 
black hole storage engine, similar to the Unix / dev / null, Archive only receives but does not save the data. Query on the table this engine often returns an empty set. Such a table may be applied to the DML statement needs to be sent from the server, but does not retain the primary server and the backup of such data from the master configuration. 

CSV 
its table really is a comma-delimited text file. CSV table allows you to import and export data in CSV format, the same format and read and write scripts and applications interact with data. Since CSV table without an index, you'd better put InnoDB table data in general will operate only in the import or export phase uses about CSV table. 

Memory 
stores all data in memory, applied to the scene to look for non-critical data by fast. Memory type table access data very quickly, because it's data is stored in memory, and uses HASH indexes by default, but once the service is shut down, the data table will be lost 

InnoDB 
MySql 5.6Version of the default storage engine. InnoDB is a transaction-safe storage engine that has commit, rollback, and crash recovery features to protect user data. The main non-OLTP application-oriented aspects, which features a row lock settings, support for foreign keys, and support similar to Oracle's locking read, which is the default read no lock case, 

the NDB 
the NDB storage engine is a clustered storage engine, similar to Oracle the RAC, but it is Share Nothing architecture, thus providing higher levels of high availability and scalability. NDB is characterized by all the data in memory, and therefore very fast lookup by the primary key. 
About NDB, there is a problem to note its connection (join) operation in a MySQL database layer is completed, not completed in the storage engine layer, which means that complex join operations require huge network overhead, the query can be slow. 

Archive 
As its name implies, is Archive for archival data storage, such as log information. It only supports INSERT and SELECT operations, the main purpose of which is designed to provide high-speed insertion and compression. 

Memory 
Memory Storage Engine (formerly called Heap) The data in the table is stored in memory, if the database is restarted or crashes, data loss, it is ideally suited to store temporary data.
Characteristics of various storage engines introduced

                                                      Mysql storage engine used in                                            

View the current default storage engine: 

MySQL > Show the Variables like " default_storage_engine " ; 

to query the current database storage engine supports 

MySQL > Show Engines \ G;

Specify the storage engine to build the table                                                          

Specify when construction of the table                        

MySQL> Create Table AI (ID BIGINT (12 is), name VARCHAR (200 is)) ENGINE = MyISAM; 

MySQL > Create Table Country (ID int (. 4), CNAME VARCHAR (50)) ENGINE = the InnoDB; 

may be used alter table statement modify an existing table storage engine. 

MySQL > ALTER Engine Table AI = InnoDB;

Specified in the configuration file                 

my.ini file 
[mysqld] 
default -storage-Engine = INNODB

 

Guess you like

Origin www.cnblogs.com/tianshuai1/p/11006409.html