Limit test for MYSQL BLOB field size and number.

Source: Internet
Author: User
Tags compact mysql version

Test conclusion
MySQL version 5.1
Table type: InnoDB, Row_format=compact (this is the default row format)


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


Note that if the MySQL server version 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 5.5
Table type: InnoDB, Row_format=compact (this is the default row format)
Inserting more than 10 blobs, the BLOB has a 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)
Inserting more than 10 blobs, the BLOB has a large amount of data (>768 bytes), inserted successfully


Note:
1) actual test test the length of each field I use is 100k+
2) for mysql5.5, although support Barracuda. But the default is to use the old format: antelope
Unless MY.CNF modified in MySQL configuration:
innodb_file_per_table = 1
Innodb_file_format = Barracuda
or the dynamic modification of 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 affects only the tables that are created later. Which is the subsequent creation of the table, can support the Row_format set to dynamic
2) SET GLOBAL is only valid during the MySQL server run, Innodb_file_format reverts to the original format after reboot.
3) A simple way to determine whether a table supports more than 10 blobs of fields:
Show table status like ' T1 ' \g
View Row_format, if the compact, must not be supported, if it is dynamic.


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.