开发者

Why is NHibernate SchemaUpdate much slower in MySQL then in MS SQL Server

开发者 https://www.devze.com 2023-02-16 19:20 出处:网络
We use SchemaUpdate.Execute() to update the database schema structure on application upgrades in an NHibernate application which works in both the MySQL5Dialect and the MsSql2008Dialect. The database

We use SchemaUpdate.Execute() to update the database schema structure on application upgrades in an NHibernate application which works in both the MySQL5Dialect and the MsSql2008Dialect. The database has about 220 tables. It takes only several seconds to execute against MsSql but may take 10 minutes or even more to execute against MySql. It doesn't seem to matter how many actual schema changes there are - it is the comparison that takes so long.

Has anyone else experienced slow performance on SchemaUpdate.Execute() for MySql? And is there anything I can do, either in the application, or the database, to optimize it?开发者_StackOverflow社区


Most likely this is occurring because you're not using innodb, which means ddl changes have to copy all the data and rebuild all the indexes.

Why is this faster on MsSql? Because it has proper ddl support.

Try changing your table store to innodb, I'm sure you'll be pleasantly surprised.

0

精彩评论

暂无评论...
验证码 换一张
取 消