What are the differences between MyISAM and InnoDB in the--mysql engine of the interview often asked?

Source: Internet
Author: User

A simple summary

innodb:
support transactions such as
No lock read
support foreign key
support row lock
Index of fulltext type is not supported
does not save the exact number of rows in the table, scans the table to calculate how many rows
delete table, is a row of delete
innodb store data and indexes in Tablespace
cross-platform can be directly copied using
innodb must contain the index of the Auto_increment type field
Span style= "font-family:"microsoft yahei"" > table is hard to compress

myisam:
transaction not supported, rollback will result in incomplete rollback, no atomicity
foreign key is not supported
support full-text search
Save the exact number of rows in a table, without where, directly return the saved rows
delete table, drop table first, then rebuild table
myisam table is stored in three files. The frm file holds the table definition. The data file is MyD (MYData). Index file is myi (myindex) extension
Cross platform difficult to copy directly
myisam enables the Auto_increment type field to be set up in a federated index
table can be compressed

Choose:
Because MyISAM is relatively simple, it is better than innodb in efficiency. If the system reads more, write less. Low requirements for atomicity. So MyISAM the best choice. and the MyISAM recovery speed is fast. Can be restored directly with backup coverage.
If the system reads less and writes more, especially when the concurrent writes are high. InnoDB is the first choice.
Both types have their own pros and cons, choose the one that completely depends on your actual class.

Scenarios for MyISAM and InnoDB

MyISAM Suitable for: (1) do a lot of count calculation, (2) Insert infrequently, query very frequently; (3) No transaction.

InnoDB Suitable for: (1) High reliability requirements, or request transactions, (2) Table updates and queries are fairly frequent, and table locking opportunities are relatively large cases.

For more detailed instructions, see: http://www.cnblogs.com/wt645631686/p/6868678.html

What are the differences between MyISAM and InnoDB in the--mysql engine of the interview often asked?

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.