content_image/761151.jpg content_image/761147.jpg
## Adding Tables to a General Tablespace 

After creating a general tablespace, CREATE TABLE tbl_name  ... TABLESPACE [=] tablespace_name  or ALTER TABLE tbl_name  TABLESPACE [=] tablespace_name  statements can be used to add tables to the tablespace, as shown in the following examples: 

## General Tablespace Row Format Support 

CREATE TABLE : 

mysql> CREATE TABLE t1 (c1 INT PRIMARY KEY) TABLESPACE ts1; 

ALTER TABLE : 

mysql> ALTER TABLE t2 TABLESPACE ts1; 

<img src='content_image/761151.jpg'>

For detailed syntax information, see CREATE TABLE  and ALTER TABLE . 

## Note 

Support for adding table partitions to shared tablespaces was deprecated in MySQL 5.7.24 and removed in MySQL 8.0.13. Shared tablespaces include the InnoDB system tablespace and general tablespaces. 

General tablespaces support all table row formats ( REDUNDANT , COMPACT , DYNAMIC , COMPRESSED ) with the caveat that compressed and uncompressed tables cannot coexist in the same general tablespace due to different physical page sizes. 

For a general tablespace to contain compressed tables ( ROW_FORMAT=COMPRESSED ), the FILE_BLOCK_SIZE  option must be specified, and the FILE_BLOCK_SIZE  value must be a valid compressed page size in relation to the innodb_page_size  value. Also, the physical page size of the compressed table ( KEY_BLOCK_SIZE ) must be equal to FILE_BLOCK_SIZE/1024 . For example, if innodb_page_size=16KB  and FILE_BLOCK_SIZE=8K , the KEY_BLOCK_SIZE  of the table must be 8. 

The following table shows permitted innodb_page_size , FILE_BLOCK_SIZE , and KEY_BLOCK_SIZE combinations. FILE_BLOCK_SIZE  values may also be specified in bytes. To determine a valid KEY_BLOCK_SIZE  value for a given FILE_BLOCK_SIZE , divide the FILE_BLOCK_SIZE  value by 1024. Table compression is not support for 32K and 64K InnoDB  page sizes. For more information about KEY_BLOCK_SIZE , see CREATE TABLE , and Section 15.9.1.2, “Creating Compressed Tables” . 

<img src='content_image/761147.jpg'>

