O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling Compression for General Tablespace

First, you need to create a compressed tablespace by mentioning FILE_BLOCK_SIZE; you cannot alter the tablespace's FILE_BLOCK_SIZE.

If you wish to create a compressed table, you need to create the table in the general tablespace, where the compression is enabled; moreover KEY_BLOCK_SIZE must be equal to FILE_BLOCK_SIZE/1024. If you do not mention KEY_BLOCK_SIZE, the value will be automatically taken from FILE_BLOCK_SIZE.

You can create multiple compressed general tablespaces with different FILE_BLOCK_SIZE values and just add the tables to the desired tablespace:

  1. Create a general compressed tablespace. You can create one with FILE_BLOCK_SIZE  of 8k and other with FILE_BLOCK_SIZE of 4kand move ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required