MYSQL BLOB field size and number limit test.

Source: Internet
Author: User
Tags compact

Test results
MySQL Version number 5.1
Table type: InnoDB, Row_format=compact (this is the default row format)


Inserting more than 10 blobs, the BLOB has a very small amount of data (<768 bytes), and the insert succeeds.
Inserting more than 10 blobs, the BLOB has a very large amount of data (>768 bytes), insert failed: reported Got error 139 from storage engine.


Note that assuming the MySQLServer version number is 5.1, the Innodb_file_format option does not exist and there is no way to talk about the Barracuda format. It doesn't make sense to set row_format=dynamic.


MySQL version number 5.5
Table type: InnoDB, Row_format=compact (this is the default row format)
Inserting more than 10 blobs, the BLOB has a very large amount of data (>768 bytes), insert failed: reported Row size too large (> 8126). Changing some columns to TEXT or BLOB or using row_format=dynamic or row_format=compressed may help. In the current row format, the BLOB prefix of 768 bytes is stored inline.


Table type: InnoDB, row_format=dynamic (this is the row format supported by InnoDB's new file storage format Barracuda)
Insert more than 10 blobs, BLOB data volume is very large (>768 bytes), insert successful


Note:
1) The actual test test I used every field length is 100k+
2) for mysql5.5, although support Barracuda. But the default is to use the old format: antelope
Except for my.cnf changes in MySQL configuration:
innodb_file_per_table = 1
Innodb_file_format = Barracuda
Or a dynamic change to the set global command:
SET GLOBAL Innodb_file_format=barracuda;
SET GLOBAL innodb_file_per_table=1;


Attention:
1) The modified Innodb_file_format format only affects the tables that might be created. Which is the table that might be created to support the setting of Row_format to dynamic
2) SET GLOBAL is only valid during MySQLServer execution and Innodb_file_format reverts to its original format after reboot.
3) An easy way to infer whether a table supports more than 10 blobs of fields:
Show table status like ' T1 ' \g
View Row_format, assuming the compact, is not necessarily supported, assuming that the dynamic is supported.


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.