[英]Slow insert in MySQL innoDB table when adding secondary key
I have a buffing problem with an InnoDB table that I cannot figure out: 我的InnoDB表有一个抛光问题,我无法弄清楚:
What is going on here? 这里发生了什么? I suspect the answer is in the way InnoDB stores indexes, but after a lot of reading, I can't figure it out. 我怀疑答案是InnoDB存储索引的方式,但是经过大量阅读,我无法弄清楚。 What's weirdest of all is that the same table, with all the indexes added, with MyISAM engine always works at 5000 records/sec. 最奇怪的是,使用MyISAM引擎的同一个表(添加了所有索引)始终以5000条记录/秒的速度工作。
I don't know why. 我不知道为什么 But the MySQL website provides a performance tuning tip for inserting into InnoDB with secondary keys (which implies to me that this is just the way it is and you have to deal with it): "If you have UNIQUE constraints on secondary keys, you can speed up table imports by temporarily turning off the uniqueness checks during the import session..." 但是MySQL网站提供了一个性能调优技巧,用于使用辅助键将其插入InnoDB(这对我意味着这就是事实,因此您必须加以处理): “如果您对辅助键具有唯一约束,则可以通过在导入会话期间暂时关闭唯一性检查来加快表导入速度。”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.