标签:文件存储 字节 key mysq was 也有 dex arc block
一、确定varchar长度设定对文件存储大小的影响OK
时间: 0.011s
mysql>alter table test4 add column g varchar(769);
mysql>create index idx_test4_g on test4(g);
create index idx_test4_g on test4(g)
1071 - Specified key was too long; max key length is 3072 bytes
时间: 0.003s
原因:
因为字符串的字符集采用了utf8mb4,一个字符占4个字节,3072/4=768.
结论:
所以,字符串长度最好限制在768之内。
标签:文件存储 字节 key mysq was 也有 dex arc block
原文地址:https://blog.51cto.com/291268154/2493800