当前位置:网站首页>char和varchar区别
char和varchar区别
2022-06-23 06:28:00 【超级码里喵】
char是一种固定长度的类型,无论储存的数据有多少都会固定长度,如果插入的长度小于定义长度,则可以用空格进行填充。而varchar是一种可变长度的类型,当插入的长度小于定义长度时,插入多长就存多长。
char和varchar区别
1、最大长度:
char最大长度是255字符,varchar最大长度是65535个字节。
2、定长:
char是定长的,不足的部分用隐藏空格填充,varchar是不定长的。
3、空间使用:
char会浪费空间,varchar会更加节省空间。
4、查找效率:
char查找效率会很高,varchar查找效率会更低。
5、尾部空格:
char插入时可省略,varchar插入时不会省略,查找时省略。
边栏推荐
- 别找了诸位 【十二款超级好用的谷歌插件都在这】(确定不来看看?)
- Endnote20 tutorial sharing (unfinished
- Redis设置密码
- 313. super ugly number
- Xiaobai must see in investment and wealth management: illustrated fund buying and selling rules
- MySQL(五) — 锁及事务
- 318. 最大单词长度乘积
- 【AI实战】机器学习数据处理之数据归一化、标准化
- Specific help of OSI layered model to work
- Akamai-1.75版本-_abck参数生成-js逆向分析
猜你喜欢

Traversal of binary tree and related knowledge

Advanced drawing skills of Excel lecture 100 (VIII) -excel drawing WiFi diagram

GloRe

407 stack and queue (232. implementing queue with stack, 225. implementing stack with queue)

Mysql(十一) — MySQL面试题整理

JUnit unit test reports an error org junit. runners. model. InvalidTestClassError: Invalid test class ‘xxx‘ . No runnable meth

20220621 Dual Quaternion

Regular expression graph and text ultra detailed summary without rote memorization (Part 1)

GIS实战应用案例100篇(七十九)-多规整合底图的制作要点

MYSQL牛客刷题
随机推荐
TP6+Redis+think-queue+Supervisor实现进程常驻消息队列/job任务
宝塔忘记密码
TP6 安装拓展
20220621 Three Conjugates of Dual Quaternions
滚动播报效果的实现
【AI实战】机器学习数据处理之数据归一化、标准化
【2022毕业季】从毕业到转入职场
Arthas-thread命令定位线程死锁
[system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed
PSP code implementation
Nacos适配oracle11g-修改Nacos源码
316. 去除重复字母
The List
云原生落地进入深水区,博云容器云产品族释放四大价值
301. delete invalid brackets
897. 递增顺序搜索树
Verilog syntax explanation
UNET code implementation
[shell] tree command
如何在 PHP 中进行日期格式验证检查(正则)