The InnoDB storage engine supports the check function of foreign key constraints. These constraints include delete, update, and cascade what is the specific meaning of this, and will be added later.
However, the above benefits require that the database server spend additional costs to perform such checks, increasing the burden on the database server, which in turn affects the performance of the database. However, if the MyISAM engine is used, if there is a foreign key association, then this type of association needs to be processed at the application level to ensure the integrity of the data. DBA database administrator wants to create a topology association, which will make it difficult to restore a single table When loading tables that depend on other tables, MySQL allows you to temporarily disable foreign key checking, thereby reducing the difficulty For tables with foreign keys, you need to pay attention to this problem.
Tech Community Register Log in. FaceBook Share. The benefits or advantages of foreign key constraint checking foreign key enhancement are: 1 If the association design is appropriate, it can make it more difficult for programmers to introduce data inconsistency into the database 2 The database server has a centralized constraint checking function, which eliminates the need for this type of checking on the data on the application side, thereby avoiding different reference programs using different methods to check constraints.
Write My Article. Another important difference: table-level locks and row-level locks. Myisam is a table lock, which means that you insert, update, delete a record of the whole table is locked, whose writing operation is efficient? The answer above is really sweaty. Mysiam separates index from data in storage and occupies less space.
But table damage cannot recover data. In a word, mysiam is suitable for applications with more reads and fewer writes, and does not require high data consistency recovery.
In general, web applications use InnoDB. InnoDB storage engine provides transaction security with commit, rollback and crash recovery capabilities. MyISAM: Mainly read and insert operations, but very few update and delete operations, and transaction integrity, concurrency requirements are not high, choose this storage engine is more appropriate.
It is also one of the most commonly used storage engines in web, data warehousing and other application environments. InnoDB: For transactional applications that support foreign keys.
If the application has high requirements for transaction integrity and data consistency under concurrent conditions, and data operations include many updates and deletions besides insertion and query, InnoDB should be a more suitable choice.
But there are not many examples of this kind in actual projects, and I still have many choices about storage without using transaction operations. Would it be better to do read-write separation? But if we want to switch the main Treasury election, it will be in the way.
DBA Database Administrator To create a topology association, this will result in a difficulty of recovering a single inclusion when loading tables on other tables, MySQL allows you to temporarily prohibit foreign key check, thereby reducing this difficulty. For tables with foreign key, you need to pay attention to this problem. Because of the mysql on the server, I don't know why, I can't set the storage engine for INNODB, so there is a need to change the storage engine of all tables of a library to Myisam.
The difference between myisam and innodb mainly lies in transactions, foreign keys, and lock granularity: Myisam does not support transactions, foreign keys, and can only lock the table when updating These two table types have excellent, 5. There are many differences between them, mainly because of different focuses. It is designed to be a large num When configuring mysql, I set the default storage engine in the configuration file to InnoDB.
In the seventh article of the article, "MyI Mysql MyISAM database batch conversion table engine is Innodb Recently, in transaction processing, the table structure needs to be changed to Innodb engine format with supporting transactions.
0コメント