当前位置:网站首页>What is the difference between varchar and char?
What is the difference between varchar and char?
2022-04-23 02:45:00 【Mechanical bucket running】
Difference one , Set and lengthen
char It means fixed length , Fixed length ,varchar It means longer , I.e. variable length .char If the inserted length is less than the defined length , Fill with spaces ;varchar Less than the defined length , It is still stored according to the actual length , Save as long as you insert .
Because its length is fixed ,char The access speed is still faster than varchar It's much faster , Convenient program storage and search ; however char It's also the price of space , Because its length is fixed , So it takes up extra space , It can be said that space in exchange for time efficiency .varchar On the contrary , Time for space .
The second difference , Different storage capacity
Yes char Come on , The maximum number of characters that can be stored 255, It's not about coding .
and varchar Well , Can store at most 65532 Characters .varchar The maximum effective length of is determined by the maximum line size and the character set used . The overall maximum length is 65,532 byte .
————————————————
Copyright notice : This paper is about CSDN Blogger 「 Slow ugly duckling 」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/qq_20264581/article/details/83755789
版权声明
本文为[Mechanical bucket running]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220745203538.html
边栏推荐
- The way to conquer C language
- Huashu "deep learning" and code implementation: 01 Linear Algebra: basic concepts + code implementation basic operations
- 国产轻量级看板式Scrum敏捷项目管理工具
- JZ22 链表中倒数最后k个结点
- [xjtu Computer Network Security and Management] session 2 Cryptographic Technology
- Halo open source project learning (I): project launch
- 第46届ICPC亚洲区域赛(昆明) B Blocks(容斥+子集和DP+期望DP)
- LeetCode 1450 - 1453
- Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet
- Rich intelligent auxiliary functions and exposure of Sihao X6 security configuration: it will be pre sold on April 23
猜你喜欢
基于Scrum进行创新和管理
C语言 171. 最近回文数
Web learning record (medium)
Slave should be able to synchronize with the master in tests/integration/replication-psync. tcl
php+mysql对下拉框搜索的内容修改
Looking for a job, writing a resume to an interview, this set of information is enough!
Those years can not do math problems, using pyhon only takes 1 minute?
Handwritten memory pool and principle code analysis [C language]
Understanding process (multithreading primary)
解决win7 中powershell挖矿占用CPU100%
随机推荐
Hack the box optimum
Global, exclusive and local routing guard
ROP Emporium x86_64 7~8题
Rhcsa second day operation
JVM runtime data area (I)
Huashu "deep learning" and code implementation: 01 Linear Algebra: basic concepts + code implementation basic operations
Log cutting - build a remote log collection server
一、序列模型-sequence model
OCR识别PDF文件
ROP Emporium x86_ 64 7 ~ 8 questions
基于多态的职工管理系统源码与一些理解
Yes, from today on, our fans can participate in Netease data analysis training camp for free!
leetcode 烹飪料理
php+mysql对下拉框搜索的内容修改
windows MySQL8 zip安装
Flink stream processing engine system learning (II)
Execute external SQL script in MySQL workbench and report error
Practical combat of industrial defect detection project (II) -- steel surface defect detection based on deep learning framework yolov5
hack the box optimum靶机
Halo open source project learning (I): project launch