Are there any pitfalls / things you need to know when changing from MyISAM to InnoDB

后端 未结 6 1053
遇见更好的自我
遇见更好的自我 2021-02-01 11:02

One of my projects use the MyISAM engine in MySQL, but I\'m considering changing it to InnoDB as I need transaction support here and there.

  • What should I look at o
6条回答
  •  一整个雨季
    2021-02-01 11:13

    Yes absolutely, there are many things, you should test your application extremely thoroughly:

    • Transactions can deadlock and need to be repeated. This is the case (in some circumstances) even with an autocommitted transaction which only inserts one row.
    • Disc usage will almost certainly increase
    • I/O load during writes will almost certainly increase
    • Behaviour of indexing will change because InnoDB uses clustered indexes - this may be a beneficial effect in some cases
    • Your backup strategy will be impacted. Consider this carefully.

    The migration process itself will need to be carefully planned, as it will take a long time if you have a lot of data (during which time the data will be either readonly, or completely unavailable - do check!)

提交回复
热议问题