MySQL 8.0 Alter Table Algorithm = INSTANT无法正常工作需要40秒

问题描述

MysqL 8.0-如MySQL Official DocMySQL Server Team中所述,Alter table with Algorithm = INSTANT立即添加该列而无需任何锁定。

但是,结果却有所不同。

测试设置-具有40M行的表格。在桌子上读写(1000 TPS)。表架构非常简单。

field,type,null,key,default,extra
id,bigint(20),NO,PRI,auto_increment
t_a,MUL,""
t_b,""
t_c,int(11),"",1,""

下文:AWS RDS MysqL 8-引擎版本-8.0.17

测试案例: 在表中添加新列。

声明:

alter table table_name add column_name int,algorithm=instant;

结果:

MysqL> alter table test_table add test_column int,algorithm=instant;
Query OK,0 rows affected (36.06 sec)
Records: 0  Duplicates: 0  Warnings: 0

花费了〜40秒。在 40秒

中,它已阻止读取和写入

这是预期吗?有什么我想念的吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)