背景: 前段时间,业务需要,为了快速让解析的Excel入库,所以把不是很确定的字段全部设置成了TEXT. 今天需要进行表结构优化,把字段长度控制在合适的范围,并尽量不使用TEXT类型. -- 计算长度select LENGTH(CAST(fileName AS CHAR)) from files; select MAX(LENGTH(CAST(fileName AS CHAR))) from files; select LENGTH(CAST(fileName AS CHAR)) as le f…
BLOB是一个二进制大对象,可以容纳可变数量的数据.有4种BLOB类型:TINYBLOB.BLOB.MEDIUMBLOB和LONGBLOB.它们只是可容纳值的最大长度不同. A binary large object that can hold a variable amount of binary data. The sorting and comparison of the values for these objects is performed in case-sensitive m…