Oracle/MySQL:如果数据库具有相同的模型,那么两个数据库都应该是InnoDB吗?

发布于 2025-01-04 00:25:28 字数 1432 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡看悲欢离合 2025-01-11 00:25:28

我不太确定你的问题是什么。如果您澄清,我会尽力提供更好的答案。

不管怎样,MySQL有多种存储引擎。 MyISAM 和 InnoDB 是其中两个(还有其他)。每个引擎都有不同的属性,例如性能、功能等。

这是关于外键的 MySQL 文档

对于InnoDB以外的存储引擎,MySQL Server解析FOREIGN
CREATE TABLE 语句中的 KEY 语法,但不使用或存储它。

MySQL 使数据库开发人员可以选择使用哪种方法。
如果您不需要外键并且想避免开销
与强制引用完整性相关,您可以选择
另一种存储引擎,例如 MyISAM。 (例如,
MyISAM 存储引擎为应用程序提供非常快的性能
仅执行 INSERT 和 SELECT 操作...)。

换句话说,如果您使用 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:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文