InnoDB Page Compression SQL Compression Syntax Warnings and Errors for General Tablespaces •If  FILE_BLOCK_SIZE  was not defined for the general tablespace when the tablespace was created, the tablespace cannot contain compressed tables. If you attempt to add a compressed table, an error is returned, as shown in the following example: mysql>  CREATE TABLESPACE ‘ts1‘ ADD DATAFILE ’ts1.ibd’ Engine=InnoDB; mysql>  CREATE TABLE t1 (c1 INT PRIMARY KEY) TABLESPACE ts1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ERROR 1478 (HY000): InnoDB: Tablespace ‘ts1‘ cannot contain a COMPRESSED table mysql>  CREATE TABLESPACE ‘ts2‘ ADD DATAFILE ’ts2.ibd’ FILE_BLOCK_SIZE = 8192 Engine=InnoDB; mysql>  CREATE TABLE t2 (c1 INT PRIMARY KEY) TABLESPACE ts2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; ERROR 1478 (HY000): InnoDB: Tablespace ‘ts2‘ uses block size 8192 and cannot contain a table with physical page size 4096 •Attempting to add a table with an invalid  KEY_BLOCK_SIZE  to a general tablespace returns an error, as shown in the following example: For general tablespaces, the  KEY_BLOCK_SIZE  of the table must be equal to the  FILE_BLOCK_SIZE  of the tablespace divided by 1024. For example, if the  FILE_BLOCK_SIZE  of the tablespace is 8192, the KEY_BLOCK_SIZE  of the table must be 8. •Attempting to add a table with an uncompressed row format to a general tablespace configured to store compressed tables returns an error, as shown in the following example: mysql>  CREATE TABLESPACE ‘ts3‘ ADD DATAFILE ’ts3.ibd’ FILE_BLOCK_SIZE = 8192 Engine=InnoDB; mysql>  CREATE TABLE t3 (c1 INT PRIMARY KEY) TABLESPACE ts3 ROW_FORMAT=COMPACT; ERROR 1478 (HY000): InnoDB: Tablespace ‘ts3‘ uses block size 8192 and cannot contain a table with physical page size 16384 innodb_strict_mode  is not applicable to general tablespaces. Tablespace management rules for general tablespaces are strictly enforced independently of  innodb_strict_mode . For more information, see Section 13.1.21, “CREATE TABLESPACE Statement” . For more information about using compressed tables with general tablespaces, see Section 15.6.3.3, “General Tablespaces” . InnoDB  supports page-level compression for tables that reside in file-per-table tablespaces. This feature is referred to as  Transparent Page Compression . Page compression is enabled by specifying the  COMPRESSION  attribute with  CREATE TABLE  or  ALTER TABLE . Supported compression algorithms include  Zlib  and  LZ4 . Page compression requires sparse file and hole punching support. Page compression is supported on Windows with NTFS, and on the following subset of MySQL-supported Linux platforms where the kernel level provides hole punching support: •RHEL 7 and derived distributions that use kernel version 3.10.0-123 or higher •OEL 5.10 (UEK2) kernel version 2.6.39 or higher •OEL 6.5 (UEK3) kernel version 3.8.13 or higher 15.9.2 InnoDB Page Compression Supported Platforms 3161