简体   繁体   English

如何在不影响生产性能的情况下向超过10 GB的innodb mysql表添加新列?

[英]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.

相关问题 如何在不影响生产性能的情况下将索引添加到18 GB innodb mysql表中? - How to add index to 18 GB innodb mysql table without affecting production performance? MySQL如何在不触发修复的情况下向innodb表添加新的多列索引? - MySQL How to add a new multicolumn index to an innodb table without triggering a repair? 300 GB Innodb的MySQL 5.7性能问题 - MySQL 5.7 performance issue with 300 GB Innodb CakePHP的新功能->如何向MySQL表添加列? - New to CakePHP -> How To Add Columns To a MySQL Table? 如果没有时间戳列而又不保留状态数据库,如何确定MySQL InnoDB表是否已被修改? - How to determine if a MySQL InnoDB table has been modified if there are no timestamp columns, without keeping a state database? 如果引擎是InnoDB / MYISAM,我们可以在mysql表中添加几列? - how many columns we can add in mysql table if engine is InnoDB/MYISAM? 如何在不索引列的情况下在innodb表中添加外键约束? - How do I add foreign key constraints in my innodb table without indexing the columns? 在不影响现有记录的情况下将新的XML数据导入MySQL表 - Import new XML data into MySQL table without affecting existing records 如何在不列出其他现有列的情况下将新列添加到MySQL表 - How to add new column to MySQL table without listing other existing columns 如何在同一个表上查询UNION并创建新列mysql? - How to query UNION over same table and create new columns mysql?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM