Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
今天我检查了 wordpress 数据库的表,但我找不到关联表的外键,谁能告诉我为什么 wordpress 没有外键?
WordPress 使用 MyISAM,因为它具有更多功能和更好的性能,但 MyISAM 不支持外键。这是一个权衡。
外键只是约束——它们更容易保持数据的完整性,但不需要关联表。Wordpress 使用 MySQL,MySQL 可以使用许多“引擎”来存储表,但 AFAIK 只有其中一个(InnoDB)支持外键。Wordpress 可能出于性能原因决定不使用它。
或者