为什么MySQL的MyISAM引擎不支持外键?
我正在为我的研究写一个网络应用程序,包括全文搜索和外键。
I am writing a web-app for my studies which includes fulltext search and foreign keys.
我读过的地方,MyISAM引擎适用于全文搜索, 。
I have read somewhere, MyISAM engine is suitable for fulltext searching, and InnoDB for foreign keys.
在这种情况下,我应该使用什么引擎达到最佳性能?
In this situation what engine should I use for the best performance?
- 为什么MyISAM不支持外键关系,而是InnoDB?
- 为什么MyISAM支持全文搜索,但InnoDB不支持?
- Why does MyISAM not support foreign key relationship but InnoDB does?
- Why does MyISAM support full text search but InnoDB does not?
请告诉我,必须使用以提高性能?
Kindly tell me, In this situation what engine I have to use for improve performance?
每个存储引擎的性能将取决于您执行的查询。但是,请注意,同一数据库中的不同表格可以使用不同的存储引擎。
The performance of each storage engine will depend on the queries you perform. However, be aware that different tables within the same database can use different storage engines.
为什么MyISAM引擎不支持外键关系和InnoDB?
Why MyISAM engine does not support foreign key relationship and InnoDB does?
如外键主要差异:
稍后,外键约束
MyISAM
表。
因此,外键约束
Therefore, foreign key constraints have simply not yet been implemented in MyISAM
.
EDIT :由于该注释已从文档中删除,因此似乎不再计划在 MyISAM
引擎中实现外键约束。
EDIT: As that comment is removed from docs, it appears that it is no longer planned to implement foreign key constraints in MyISAM
engine.
Why MyISAM engine does support full text search and InnoDB does not?
As documented under What Is New in MySQL 5.6:
您可以创建
FULLTEXT
在InnoDB
表上创建索引,并使用MATCH()... AGAINST
语法。
You can create
FULLTEXT
indexes onInnoDB
tables, and query them using theMATCH() ... AGAINST
syntax.
因此,从MySQL 5.6开始, InnoDB
已执行全文搜索。
Therefore, full text search has been implemented in InnoDB
as of MySQL 5.6.