An in-depth analysis based on Mysql storage engine _mysql

Source: Internet
Author: User
Tags mysql manual

MySQL has a number of storage engines, for different applications, you can choose the appropriate storage engine for each table, which helps improve MySQL performance.
To create a news statement:

Copy Code code as follows:

CREATE TABLE ' sandbox '. ' News '
(
' ID ' INT not NULL auto_increment,
' Name ' VARCHAR (=) NULL,
' content ' VARCHAR (=) NULL,
' Created ' VARCHAR () NULL,
PRIMARY KEY (' id ')
) ENGINE = MyISAM;

Attention, MySQL is not sensitive to the case sensitivity, is determined by the platform you use, under Windows, MySQL is not sensitive to case, the Linux platform, the MySQL case sensitive.
The last SQL statement engine= "Storage Engine name", which is to select the storage engine for the table, MySQL allows us to choose a different storage engine when creating the table, so what are the storage engines of MySQL?

MySQL storage engines include: MyISAM engine, MyISAM merge engine, InnoDB engine, memory engine, archive engine, CSV engine, Federated engine, Blackhle engine, NDB cluster engine, Falcon engine, SOLIDDB engine, PBXT engine,
Maria engine and other engines. When building a table, it is important to choose the appropriate storage engine, which can be cumbersome if you replace it later. here, we only describe the three types of storage engines that are commonly used:

MyISAM engine
The MyISAM engine is the MySQL default storage engine, MyISAM does not support transaction and row-level locks, so the MyISAM engine is fast and has excellent performance. MyISAM can lock the entire table, support concurrent inserts, and support Full-text indexing.
If you don't need transactional support, usually we use the MyISAM storage engine when we build the table, and there's no need to support transactions like a news form.

InnoDB engine
InnoDB is a transaction-designed storage engine that supports transactions, supports foreign keys, and has high concurrent processing capabilities. However, InnoDB is slower than MyISAM when creating indexes and loading data.
Involved in currency operations generally need to support business, anything can be wrong, money can not be wrong.

Memory engine
The memory table, the memory engine stores the data in memory, the table structure is not stored in memory, the query does not need to perform I/O operations, so it is much faster than MyISAM and InnoDB, but after the database is powered down or restarted, the data in the table will be lost and the table structure will not
Lost. If you need to have the session data in the database, then using the memory engine is a good choice.
Usually, we use these three kinds of storage engine enough, more introduction please check the MySQL manual.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.