[英]How to add new columns to over 10 GB innodb mysql table without affecting production performance?
I'm straightly trying to add 3 new columns to a innodb mysql table which is over 10GB and is serving (read/write) online. 我直接尝试将3个新列添加到超过10GB的innodb mysql表中,并且正在联机(读取/写入)服务。
I just used ALTER TABLE xxx add column yyy ...
as usual. 我只是像往常一样使用ALTER TABLE xxx add column yyy ...
Because of the large data scale, the altering operation is extremely time-consuming(over 10 minutes). 由于数据规模大,更改操作非常耗时(超过10分钟)。
The problem seems to be that it locks the whole table, so that it can not serve while altering. 问题似乎在于,它锁定了整个表,因此在更改时无法使用。
I'm using mysql-5.6.14, which declares to support ADD
operation online. 我正在使用mysql-5.6.14,它声明为支持在线ADD
操作。
Is it a common issue? 这是常见问题吗?
or 要么
Am I doing something wrong? 难道我做错了什么?
I don't see what went wrong. 我看不出出了什么问题。 Suggest you file a bug at bugs.mysql.com. 建议您在bugs.mysql.com上提交错误。
Meanwhile, you could use pt-online-schema-change
to do the change with virtually no downtime. 同时,您可以使用pt-online-schema-change
进行更改,而几乎没有停机时间。
From https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html#innodb-online-ddl-summary-grid 来自https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html#innodb-online-ddl-summary-grid
Concurrent DML is not allowed when adding an auto-increment column.
Are you adding an auto inc column? 您是否要添加汽车公司专栏?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.