当前位置:网站首页>Dameng database_ LENGTH_ IN_ Influence of char and charset
Dameng database_ LENGTH_ IN_ Influence of char and charset
2022-07-24 06:11:00 【ls2best】
Concept :LENGTH_IN_CHAR:VARCHAR Whether the length of the type object is in characters .
1: yes , When set to in characters , The definition length is not really adjusted according to the character length , Instead, the stored length value is enlarged according to the theoretical character length . Therefore, the actual number of characters that can be inserted exceeds the defined length , This is also allowed . meanwhile , Length of bytes stored 8188 The upper limit remains unchanged , in other words , Even if the column length is defined as 8188 character , The total byte length of the string that can actually be inserted still cannot exceed 8188;0: no , all VARCHAR The length of the type object is in bytes .
Concept :CHARSET/UNICODE_FLAG: Character set options .0 representative GB18030,1 representative UTF-8,2 Stands for Korean character set EUC-KR.
GB18030 Code down compatible GBK and GB2312, Compatibility means not only character compatibility , And the encoding of the same characters is the same .
UTF-8 Is used to solve the international character of a multi byte encoding , It uses English 8 position ( A byte ), Use of Chinese 24 by ( Three bytes ) Encoding .
GB18030 Numbers and letters account for 1 Bytes , Ordinary Chinese characters account for 2 Bytes , Some traditional and minority languages account for 4 byte ,Unicode Use... In daydream UTF-8 Coding format , European alphabetic characters account for 1 To 2 Bytes , Most of the characters in Asia account for 3 Bytes , The additional characters are 4 Bytes . If only Chinese and alphanumeric characters are stored , Generally speaking GB18030 Save more space .
Note these two parameters are generally used together ,CHARSET/UNICODE_FLAG Once it is determined that it cannot be modified , It needs to be set carefully .
such as :UNICODE_FLAG=1、LENGTH_IN_CHAR=0 A Chinese character occupies three bytes , One English occupies one byte, as shown in the figure :

UNICODE_FLAG=1、LENGTH_IN_CHAR=1 One Chinese character takes up three bytes , A letter takes up a byte , One character four bytes ( That is, a varchar The unit occupies four bytes ), You can save four English letters

UNICODE_FLAG=0、LENGTH_IN_CHAR=1 A Chinese character takes up two bytes and one character , A letter takes up a byte , One character can store one Chinese character or two English letters .

UNICODE_FLAG=0、LENGTH_IN_CHAR=0 A Chinese character takes up two bytes , An English character takes up one byte . A Chinese character takes up two bytes .
Dameng community address :https://eco.dameng.com
边栏推荐
- Day3 jvm+ sorting summary
- [activiti] personal task
- Accurate calculation of time delay detailed explanation of VxWorks timestamp
- STM32 DSP library MDK vc5\vc6 compilation error: 256, (const float64_t *) twiddlecoeff64_ 256, armBitRevIndexTableF64_ 256,
- JVM系统学习
- Foundation of JUC concurrent programming (8) -- read write lock
- Find the ArrayList < double > with the most occurrences in ArrayList < ArrayList < double >
- Lua基础
- HoloLens 2 开发101:创建首个HoloLens 2应用程序
- [MYCAT] Introduction to MYCAT
猜你喜欢
![[FatFs] migrate FatFs manually and transfer SRAM virtual USB flash disk](/img/fb/5f3d17f1f3d6e4979ece5126e2925e.png)
[FatFs] migrate FatFs manually and transfer SRAM virtual USB flash disk

Thymeleaf快速入门学习

Accessing a two-dimensional array with a pointer

HoloLens 2 中文开发文档 MRTK v2
![[activiti] personal task](/img/bc/80ac4067f6c58785acb4273f9507ee.png)
[activiti] personal task

HoloLens 2 开发101:创建首个HoloLens 2应用程序
![[deep learning] handwritten neural network model preservation](/img/4a/27031f29598564cf585b3af20fe27b.png)
[deep learning] handwritten neural network model preservation

JUC并发编程基础(7)--多线程锁

Conversion of world coordinate system, camera coordinate system and image coordinate system

Solve modularnotfounderror: no module named "cv2.aruco“
随机推荐
HoloLens 2开发:使用MRTK并在Unity中模拟手势输入
Find the ArrayList < double > with the most occurrences in ArrayList < ArrayList < double >
day6-jvm
Headlong platform operation
JS star scoring effect
Typora installation package in November 2021, the last free version of the installation package to download v13.6.1
【数据库系统原理】第四章 高级数据库模型:统一建模语言UML、对象定义语言ODL
day5-jvm
day4-jvm
信号与系统:希尔伯特变换
PDF Text merge
Read the qualified line of CSV file and write it to another CSV
[deep learning] handwritten neural network model preservation
Day-7 JVM end
Unity(三)三维数学和坐标系统
初识图形学
Introduction to QT new project
JUC并发编程基础(6)--Lock锁
常见AR以及MR头戴显示设备整理
AD1256