Tuesday, 13 November 2018

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?

 Answers

  • 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.
  • 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.
          
          As that comment is removed from docs, it appears that it is no longer planned
          to implement foreign key constraints in MyISAM engine.

    You can create FULLTEXT indexes on InnoDB tables, 
Therefore, full text search has been implemented in InnoDB as of MySQL 5.6.

0 comments:

Post a Comment