The difference between the InnoDB and MyISAM of the PHP surface question eight

Source: Internet
Author: User
Tags table definition

This article introduces the content of the PHP surface question eight of the InnoDB and MyISAM differences, has a certain reference value, now share to everyone, have the need for friends can refer to

InnoDB:
Support transaction processing, etc.
No lock Read
Support for foreign keys
Support Row lock
Index of type Fulltext not supported
Do not save the table's exact number of rows, scan the table to calculate how many rows
Delete Table is a row of deletes
InnoDB storing data and indexes in a table space
Cross-platform can be copied directly using
InnoDB must contain the index of the Auto_increment type field
Tables are hard to compress

MyISAM:
Transactions are not supported, rollback will result in incomplete rollback, no atomicity
Foreign keys are not supported
Foreign keys are not supported
Support full-Text search
Saves the exact number of rows in the table, without where, directly returning the saved rows
DELETE table, drop table first, then rebuild table
The 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 hard to copy directly
MyISAM can make the Auto_increment type field a federated index
Tables 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.

InnoDB:
Support transaction processing, etc.
No lock Read
Support for foreign keys
Support Row lock
Index of type Fulltext not supported
Do not save the table's exact number of rows, scan the table to calculate how many rows
Delete Table is a row of deletes
InnoDB storing data and indexes in a table space
Cross-platform can be copied directly using
InnoDB must contain the index of the Auto_increment type field
Tables are hard to compress

MyISAM:
Transactions are not supported, rollback will result in incomplete rollback, no atomicity
Foreign keys are not supported
Foreign keys are not supported
Support full-Text search
Saves the exact number of rows in the table, without where, directly returning the saved rows
DELETE table, drop table first, then rebuild table
The 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 hard to copy directly
MyISAM can make the Auto_increment type field a federated index
Tables 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.

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.