当每个条目都适合中文大小字段时,使用MySQL长文本大小字段的缺点是什么? [英] What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field?

查看:397
本文介绍了当每个条目都适合中文大小字段时,使用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

因此 longtext mediumtext 多一个字节来存储相同的文本。有关详细信息,请参阅手册的数据类型存储要求部分以及 BLOB和文本类型部分中的一些。

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.

这四种TEXT类型之间没有实际差异。

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

这篇关于当每个条目都适合中文大小字段时,使用MySQL长文本大小字段的缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆