I'm not exactly sure what your question is. If you clarify, I'll try and provide a better answer.
Anyway, MySQL has multiple storage engines. MyISAM and InnoDB are two of them (there are others). Each engine has different properties, such as performance, features, etc.
For storage engines other than InnoDB, MySQL Server parses the FOREIGN KEY syntax in CREATE TABLE statements, but does not use or store it.
and
MySQL gives database developers the choice of which approach to use. If you don't need foreign keys and want to avoid the overhead associated with enforcing referential integrity, you can choose another storage engine instead, such as MyISAM. (For example, the MyISAM storage engine offers very fast performance for applications that perform only INSERT and SELECT operations ...).
In other words, if you use MyISAM, you'll have to take care of foreign key checks yourself. If foreign key checks are very important to you, then I would indeed strongly suggest using InnoDB.
发布评论
评论(1)
我不太确定你的问题是什么。如果您澄清,我会尽力提供更好的答案。
不管怎样,MySQL有多种存储引擎。 MyISAM 和 InnoDB 是其中两个(还有其他)。每个引擎都有不同的属性,例如性能、功能等。
这是关于外键的 MySQL 文档:
和
换句话说,如果您使用 MyISAM,则必须自己处理外键检查。 如果外键检查对你来说非常重要,那么我确实强烈建议使用InnoDB。
I'm not exactly sure what your question is. If you clarify, I'll try and provide a better answer.
Anyway, MySQL has multiple storage engines. MyISAM and InnoDB are two of them (there are others). Each engine has different properties, such as performance, features, etc.
Here's the MySQL docs on foreign keys:
and
In other words, if you use MyISAM, you'll have to take care of foreign key checks yourself. If foreign key checks are very important to you, then I would indeed strongly suggest using InnoDB.