大型表中,MySQL INSERT语句会变慢吗? [英] are MySQL INSERT statements slower in huge tables?
本文介绍了大型表中,MySQL INSERT语句会变慢吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以看到SELECT
和UPDATE
语句如何随着表的增长和增长而变慢,但是INSERT
呢?
I can see how SELECT
and UPDATE
statements get slower as a table grows and grows, but what about INSERT
?
推荐答案
INSERT
也会变慢,特别是如果您有很多必须同时更新的索引.
INSERT
gets slower too, especially if you have a lot of indexes which have to be updated as well.
尽管不同的存储引擎之间存在差异:MyISAM
对于许多SELECT
更快,InnoDB对于许多INSERT
/UPDATE
而言更快,因为它使用了行锁定,而不是表锁定及其处理索引的方式.
There is a difference between the different storage engines though: MyISAM
is faster for a lot of SELECT
, InnoDB is faster for a lot of INSERT
/UPDATE
because it uses row locking instead of table locking and the way it handles indexes.
这篇关于大型表中,MySQL INSERT语句会变慢吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文