mysql 大文本 缺点,当每个条目都适合中文大小字段时,使用MySQL长文本大小字段的缺点是什么?...

What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field?

The reason I am asking is because I have some longtext sized fields and recently realized they are much too large, but then struggled with motivating myself to make the minute change because "what's the harm?" hence the question.

解决方案

The only storage size difference is the number of bytes allocated for the "how many bytes is this field" number. From the fine manual:

TINYTEXT L + 1 bytes, where L < 2^8

TEXT L + 2 bytes, where L < 2^16

MEDIUMTEXT L + 3 bytes, where L < 2^24

LONGTEXT L + 4 bytes, where L < 2^32

So a longtext will use one more byte than mediumtext to store the same text. There is a bit more information in the Data Type Storage Requirements section of the manual and some more in the The BLOB and TEXT Types section.

There's no practical difference between the four TEXT types.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值