我需要将varchar字段长度从255扩展到4000。
我使用的是tokudb_version:tokudb-7.5.8 running on Linux 3.16.0-60-generic #80~14.04.1-Ubuntu SMP Wed Jan 20 13:37:48 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
我知道TokuDB支持热列操作,但这并不适用于我(行数为2.1亿行)
显示变量文件:https://drive.google.com/file/d/0B5noFLrbjDjzSW9wdnVjb095Q0U/view?usp=sharing
Alter命令
alter table test_table modify test_column varchar(4000);
Show processlist:
mysql> show processlist;
+----+------+-----------+---------------+---------+------+---------------------------------------------------------+------------------------------------------------------------+-----------+---------------+
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+----+------+-----------+---------------+---------+------+---------------------------------------------------------+------------------------------------------------------------+-----------+---------------+
| 6 | root | localhost | NULL | Query | 0 | init | show processlist | 0 | 0 |
| 7 | root | localhost | test | Query | 461 | Queried about 2445001 rows, Inserted about 2445000 rows | alter table test_table modify test_column varchar(4000) | 0 | 0 |
+----+------+-----------+---------------+---------+------+---------------------------------------------------------+------------------------------------------------------------+-----------+---------------+
2 rows in set (0.00 sec)知道我可能需要设置哪些选项,因为它目前正在以每秒~ 6k的速度处理(这可能要花我10个小时)
发布于 2016-07-26 11:04:17
如果您只想要在线操作,您应该考虑根据tokudb_disable_slow_alter=ON设置https://www.percona.com/doc/percona-server/5.7/tokudb/tokudb_variables.html#tokudb_禁用_慢的_更改。
https://dba.stackexchange.com/questions/144919
复制相似问题