alter modify 字段
ALTER 对于默认的Null值是不会修改的, 如果sex存在null的情况, 下面的语句会报错
1 | ALTER TABLE customer |
必须先执行update
1 | UPDATE customer SET sex = -1 WHERE sex is NULL ; |
alter 加字段
超过10W 的数据不能直接加字段, 需要创建临时表
参考 https://zhidao.baidu.com/question/917987491401145099.html
https://help.aliyun.com/document_detail/26132.html
alter加索引
30W 条数据, 2340ms, 大概10W条数据 800ms
1 |
|