Bug #78623 | Small tablespaces with BLOBs take up to 80 times more space in 5.7 than in 5.6 | ||
---|---|---|---|
Submitted: | 29 Sep 2015 10:58 | Modified: | 19 Oct 2015 12:56 |
Reporter: | Laurynas Biveinis (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.7.8 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | BLOB, compact, compressed, innodb, ROW_FORMAT, Tablespace |
[29 Sep 2015 10:58]
Laurynas Biveinis
[29 Sep 2015 10:59]
Laurynas Biveinis
This could be very serious for users with large number of compressed tablespaces with BLOBs
[29 Sep 2015 12:04]
Morgan Tocker
The default row format for innodb tables changes from COMPACT to DYNAMIC in 5.7.9 (with the introduction of variable innodb_default_row_format as well). So I modified your test case #1 slightly: mysql [localhost] {msandbox} (test) > CREATE TABLE t2_compact (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB ROW_FORMAT=compact; Query OK, 0 rows affected (0.02 sec) mysql [localhost] {msandbox} (test) > CREATE TABLE t2_dynamic (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB ROW_FORMAT=dynamic; Query OK, 0 rows affected (0.01 sec) File sizes are the same with both row formats: -rw-r----- 1 morgo staff 8578 29 Sep 07:59 t2_compact.frm -rw-r----- 1 morgo staff 3145728 29 Sep 08:00 t2_compact.ibd -rw-r----- 1 morgo staff 8578 29 Sep 07:59 t2_dynamic.frm -rw-r----- 1 morgo staff 3145728 29 Sep 08:00 t2_dynamic.ibd
[6 Oct 2015 9:07]
MySQL Verification Team
Hello Laurynas, Thank you for the report and test case. Thanks, Umesh
[6 Oct 2015 9:07]
MySQL Verification Team
[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc/mysql-test: ./mtr foo Logging: ./mtr foo MySQL Version 5.7.8 Checking supported features... - SSL connections supported Collecting tests... Checking leftover processes... Removing old var directory... Creating var directory '/export/umesh/server/binaries/mysql-5.7.8-rc/mysql-test/var'... Installing system database... ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 DROP TABLE IF EXISTS t1; SET GLOBAL innodb_file_per_table=ON; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; Empty table: The size of t1 tablespace file in bytes: 98304 Rows inserted: 5000 The size of t1 tablespace file in bytes: 212992 Rows inserted: 10000 The size of t1 tablespace file in bytes: 344064 Rows inserted: 15000 The size of t1 tablespace file in bytes: 458752 Rows inserted: 20000 The size of t1 tablespace file in bytes: 589824 Rows inserted: 25000 The size of t1 tablespace file in bytes: 9437184 DROP TABLE t1; CREATE TABLE t2 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB; Empty table: The size of t2 tablespace file in bytes: 98304 Rows inserted: 4 The size of t2 tablespace file in bytes: 3145728 Rows inserted: 8 The size of t2 tablespace file in bytes: 3145728 Rows inserted: 12 The size of t2 tablespace file in bytes: 3145728 Rows inserted: 16 The size of t2 tablespace file in bytes: 3145728 Rows inserted: 20 The size of t2 tablespace file in bytes: 9437184 DROP TABLE t2; SET GLOBAL innodb_file_format='barracuda'; Warnings: Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html CREATE TABLE t3 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Empty table: The size of t3 tablespace file in bytes: 65536 Rows inserted: 8 The size of t3 tablespace file in bytes: 5242880 Rows inserted: 16 The size of t3 tablespace file in bytes: 5242880 Rows inserted: 24 The size of t3 tablespace file in bytes: 5242880 Rows inserted: 32 The size of t3 tablespace file in bytes: 5242880 Rows inserted: 40 The size of t3 tablespace file in bytes: 5242880 DROP TABLE t3; SET GLOBAL innodb_file_per_table=default; SET GLOBAL innodb_file_format=default; Warnings: Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html main.foo [ pass ] 3101 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 3.101 of 8 seconds executing testcases Completed: All 1 tests were successful. // 5.6.28 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28/mysql-test: ./mtr foo Logging: ./mtr foo 2015-10-06 11:05:55 0 [Note] /export/umesh/server/binaries/mysql-advanced-5.6.28/bin/mysqld (mysqld 5.6.28-enterprise-commercial-advanced) starting as process 28861 ... 2015-10-06 11:05:55 28861 [Note] Plugin 'FEDERATED' is disabled. 2015-10-06 11:05:55 28861 [Note] Binlog end 2015-10-06 11:05:55 28861 [Note] Shutting down plugin 'CSV' 2015-10-06 11:05:55 28861 [Note] Shutting down plugin 'MyISAM' MySQL Version 5.6.28 Checking supported features... - SSL connections supported Collecting tests... Removing old var directory... Creating var directory '/export/umesh/server/binaries/mysql-advanced-5.6.28/mysql-test/var'... Installing system database... ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 DROP TABLE IF EXISTS t1; SET GLOBAL innodb_file_per_table=ON; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; Empty table: The size of t1 tablespace file in bytes: 98304 Rows inserted: 5000 The size of t1 tablespace file in bytes: 212992 Rows inserted: 10000 The size of t1 tablespace file in bytes: 344064 Rows inserted: 15000 The size of t1 tablespace file in bytes: 458752 Rows inserted: 20000 The size of t1 tablespace file in bytes: 573440 Rows inserted: 25000 The size of t1 tablespace file in bytes: 9437184 DROP TABLE t1; CREATE TABLE t2 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB; Empty table: The size of t2 tablespace file in bytes: 98304 Rows inserted: 4 The size of t2 tablespace file in bytes: 196608 Rows inserted: 8 The size of t2 tablespace file in bytes: 327680 Rows inserted: 12 The size of t2 tablespace file in bytes: 458752 Rows inserted: 16 The size of t2 tablespace file in bytes: 589824 Rows inserted: 20 The size of t2 tablespace file in bytes: 9437184 DROP TABLE t2; SET GLOBAL innodb_file_format='barracuda'; CREATE TABLE t3 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Empty table: The size of t3 tablespace file in bytes: 65536 Rows inserted: 8 The size of t3 tablespace file in bytes: 65536 Rows inserted: 16 The size of t3 tablespace file in bytes: 65536 Rows inserted: 24 The size of t3 tablespace file in bytes: 65536 Rows inserted: 32 The size of t3 tablespace file in bytes: 5242880 Rows inserted: 40 The size of t3 tablespace file in bytes: 5242880 DROP TABLE t3; SET GLOBAL innodb_file_per_table=default; SET GLOBAL innodb_file_format=default; main.foo [ pass ] 2574 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 2.574 of 7 seconds executing testcases Completed: All 1 tests were successful. [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28/mysql-test:
[6 Oct 2015 20:54]
Sunny Bains
Satya has figured out the problem and we are working on the fix.
[19 Oct 2015 12:56]
Daniel Price
Posted by developer: Fixed as of the upcoming 5.7.10, 5.8.0 release, and here's the changelog entry: Compared to previous releases, small tablespaces containing tables with BLOB values had larger data files due to regression introduced in MySQL 5.7.5. Thank you for the bug report.