关于MySQL:MySQL – InnoDB与MyISAM

MySQL - InnoDB vs MyISAM

我昨天阅读了以下文章(http://blogs.sitepoint.com/2010/11/19/mysql-mistakes-php-developers/),它写了以下内容:

MySQL has a number of database engines but you’re most likely to encounter MyISAM and InnoDB.

MyISAM is used by default. However, unless you’re creating a very simple or experimental database, it’s almost certainly the wrong choice! MyISAM doesn’t support foreign key constraints or transactions which are essential for data integrity. In addition, the whole table is locked whenever a record is inserted or updated: it causes a detrimental effect on performance as usage grows.

The solution is simple: use InnoDB.

我一直使用MyISAM,因为它是默认的。 你怎么看?

如果我要升级到InnoDB,在phpMyAdmin中,我可以编辑每个表并将其更改为innoDB,还是要执行更复杂的过程?

谢谢!


是的,如果你愿意,你可以交换进出内衣等引擎,没有太多麻烦。 只需在phpmyadmin中更改它。

但我不会为了改变它而改变它。 你需要使用外键吗? 更改。 您是否需要行级锁定而不是表锁定? 更改。

值得注意的是,使用MyISAM也有充分的理由。 看看FULLTEXT索引。 你不能用InnoDB做到这一点。

UPDATE

从MySQL 5.6开始,FULLTEXT也已经为InnoDB表实现了。 这是手册。


很抱歉碰到一个老问题,但这也帮助我选择了哪个引擎,特别是因为MyISAM的读取速度更快,而且我的数据库表有更多的读取内容:

http://www.rackspace.com/knowledge_center/article/mysql-engines-myisam-vs-innodb