Mysql char varchar blob text performance details, varcharblob

Source: Internet
Author: User

Mysql char varchar blob text performance details, varcharblob

Char

Fixed Length, up to 255 bytes. If the storage space is not full, a space will be filled on the right side of the data.

Varchar

The maximum length is 65536 bytes. When the varchar length is smaller than 4, The varchar is automatically converted to char ..

Blob

Stores binary strings

TinyBlob Max. 255 bytes

Blob Max 65 K

MediumBlob up to 16 MB

Up to 4 GB LongBlob

Text

Store large text

TINYTEXT: 256 bytes
TEXT: 65,535 bytes => ~ 64kb
MEDIUMTEXT: 16,777,215 bytes => ~ 16 MB
LONGTEXT: 4,294,967,295 bytes => ~ 4 GB

Char varchar Performance Comparison

Different types are selected for different scenarios.

See: http://zhumeng8337797.blog.163.com/blog/static/100768914201112710039854/

Char:

Advantage: update is more efficient than varchar

Disadvantage: The fixed length will waste disk space, and the storage content is not filled with spaces. Due to the large disk space usage, the query efficiency is lower than that of varchar.

Varchar:

Advantage: select queries are efficient, saving disk space compared with char, so queries are faster.

Disadvantage: During update, if the new data is larger than the original data, the database needs to open up space again, which may result in performance loss. The efficiency is not fixed. The char is high.



Related Article

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.