The difference between InnoDB and MyISAM

Source: Internet
Author: User

MySQL supports many table-type tables (that is, the storage engine), such as MyISAM, InnoDB, memory, archive, example, and so on. Each storage engine has its own advantages and disadvantages, and the full understanding of each storage engine helps to use them wisely. Some people think that using multiple storage engines in the same database affects performance, which is a very wrong idea. In fact, unless it is a very simple database, using only one storage engine is a very bad behavior for the performance of the application. It's a good idea that people who know the database will choose the right storage engine based on the different roles of each table.

As mentioned earlier, MySQL has a lot of storage engines, but I personally use the most storage engine in the work of two, one is InnoDB, the other is MyISAM. I'll talk about these two storage engines, and compare the differences between them.

First, MyISAM

MyISAM is now the default storage engine for MySQL, and if no table type is specified when the table is being built, MySQL will use MyISAMby default. MyISAM There's a lot of people who think it's important, but I don't think there's an egg in it, and that means that MyISAM is independent of the operating system. The popular point is that you can easily migrate MyISAM tables from Windows to Linux or from Linux to Windows. This is really a good thing, but what technical director will have to decide to use an operating system for a period of time and then change the server's brain residual behavior, all I think this advantage has no practical significance.

The MyISAM storage Engine is a very important part of the MySQL component, and in MySQL you can create tables in 3 MyISAM formats-static, dynamic, and compression. The format does not need to be specified separately, and MySQL automatically chooses the most appropriate format based on the table structure.

1,MyISAM static

If the data type of each field in a table is defined using static (such as Char), MySQL will automatically use the static MyISAM format, and the performance of this type of table is very high, that is, the query update time is very small, but you know that this is at the expense of space. Because each column allocates the largest amount of space, even if some of the space is not used, this makes the static table occupy a larger space.

2.MyISAM News

If the data type of each field in the table is defined using dynamic (such as varchar), MySQL will automatically use the dynamic MyISAM format, and the performance of this type of table will be degraded. But it occupies much less space than static.

3,MyISAM compression

If there is a table at the beginning of the design only to give it read the mission, you can use MyISAM compression table, under the same configuration, its performance is the fastest.

Second, InnoDB

(not to be continued)

The difference between InnoDB and MyISAM

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.