Bite,byte,k,m,g and so are storage units, an English account for a few how much space, a number of space, how much space a Chinese character occupies

Source: Internet
Author: User

Q: Bite,byte,k,m,g and so are storage units, an English account for a few how much space, a number of space, how much space a Chinese character occupies. The database in a table a field B length varcha2 (20) What that means, is how much space is allocated to the field.

For:

1) Bite,byte,k,m,g, etc. are all storage units. 1byte=8bite;1k=1024byte.

2) Any one character, as long as it exists on the computer, is to occupy space.

3) The coding rules are different, the bytes accounted for are different, such as GBK encoding, the Chinese characters accounted for 2 bytes is byte;utf-8 encoded, Chinese characters accounted for 3 bytes.

5) The length of a field in the database Varcha2 (20) What it means, is how much space is allocated to the field. A Table a field B length Varcha2 (20) in an Oracle database represents 20 bytes, which means that if the database is GBK encoded, 10 characters can be stored, if utf-8 The code can save 6.666666 characters or less than 7 Chinese characters.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.