Modify the mysql table type. The test is executable.

Source: Internet
Author: User

Modify the mysql table type in the actual test. When you modify the mysql table type today, you can search for it online, saying that the alter table name type = MyISAM; alter table name type = InnoDB; an error occurred while actually executing the command locally. When querying mysql API to modify the table type, use the following statement. You have actually tested the SQL statement used to modify the mysql table Type: alter table name Engine = MyISAM; alter table name Engine = InnoDB; attached mysql table type description MyISAM: This is the default type, it is based on the traditional ISAM type, ISAM is the abbreviation of Indexed Sequential Access Method, which is a standard Method for storing records and files. Compared with other storage engines, MyISAM provides most tools for checking and repairing tables. MyISAM tables can be compressed and can be searched in full text. They are not transaction-safe and do not support foreign keys. If a transaction is rolled back, incomplete rollback is not atomic. If you execute a large number of SELECT statements, MyISAM is a better choice. InnoDB: This type is transaction-safe. It has the same features as the BDB type and supports foreign keys. The InnoDB table is fast and has more features than BDB. Therefore, if you need a transaction-safe storage engine, we recommend that you use it. If your data executes a large number of INSERT or UPDATE operations, InnoDB tables should be used for performance considerations. AUTOCOMMI is the main factor affecting the speed of the InnoDB type labels that support transactions. The default setting is open, and the program does not explicitly call BEGIN to start transactions, as a result, each inserted entry is automatically Commit, seriously affecting the speed. You can call begin before executing the SQL statement. Multiple SQL statements form a transaction (even if you open the autocommit statement), which greatly improves the performance.

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.