Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
661 views
in Technique[技术] by (71.8m points)

database - Why doesn't MySQL's MyISAM engine support Foreign keys?

I am writing a web-app for my studies which includes fulltext search and foreign keys.

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?

  • Why does MyISAM not support foreign key relationship but InnoDB does?
  • Why does MyISAM support full text search but InnoDB does not?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. 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.

  2. Why MyISAM engine does not support foreign key relationship and InnoDB does?

    As documented under Foreign Key Differences:

    At a later stage, foreign key constraints will be implemented for MyISAM tables as well.

    Therefore, foreign key constraints have simply not yet been implemented in 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.

  1. Why MyISAM engine does support full text search and InnoDB does not?

    As documented under What Is New in MySQL 5.6:

    You can create FULLTEXT indexes on InnoDB tables, and query them using the MATCH() ... AGAINST syntax.

    Therefore, full text search has been implemented in InnoDB as of MySQL 5.6.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...