加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql – varchar(255)v tinyblob v tinytext

发布时间:2020-12-12 16:33:10 所属栏目:MsSql教程 来源:网络整理
导读:我的另一个问题是,tinyblob和amp TINYTEXT? 购买我真正的问题是什么原因,如果有的话,我会选择varchar(255)over tinyblob或tinytext? 解决方法 主要是 storage requirements和内存处理/速度: In the following table, M represents the declared column len
我的另一个问题是,tinyblob和amp TINYTEXT?

购买我真正的问题是什么原因,如果有的话,我会选择varchar(255)over tinyblob或tinytext?

解决方法

主要是 storage requirements和内存处理/速度:

In the following table,M represents the declared column length in characters for nonbinary string types and bytes for binary string types. L represents the actual length in bytes of a given string value.

VARCHAR(M),VARBINARY(M):
L + 1
bytes if column values require 0 – 255
bytes,
L + 2 bytes if values may
require more than 255 bytes

TINYBLOB,TINYTEXT:
L + 1 bytes,where L < 28

另外,见this帖子:

For each table in use,MySQL allocates
memory for 4 rows. For each of these
rows CHAR(X)/VARCHAR(X) column takes
up the X characters.

A TEXT/BLOB on the other hand is
represented by a 8 byte pointer + a
1-4 byte length (depending on the
BLOB/TEXT type). The BLOB/TEXT is
allocated dynamicly on use. This will
use less memory,but in some cases it
may fragment your memory in the long
run.

编辑:除此之外,blob存储二进制数据和文本存储ASCII,这是TINYBLOB和TINYTEXT之间的唯一区别.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读