Configuring compression
You configure a table property and subproperties to manage compression. CQL table properties describes the available options for compression. Compression is enabled by default.
Procedure
-
Disable compression, using CQL to set the compression parameter
enabled
tofalse
.CREATE TABLE DogTypes ( block_id uuid, species text, alias text, population varint, PRIMARY KEY (block_id) ) WITH compression = { 'enabled' : false };
-
Enable compression on an existing table, using
ALTER TABLE
to set the compression algorithmclass
toLZ4Compressor
,SnappyCompressor
, orDeflateCompressor
.CREATE TABLE DogTypes ( WITH compression = { 'class' : 'LZ4Compressor' };
-
Change compression on an existing table, using
ALTER TABLE
and setting the compression algorithmclass
toDeflateCompressor
.ALTER TABLE CatTypes WITH compression = { 'class' : 'DeflateCompressor', 'chunk_length_in_kb' : 64 }
Tune data compression on a per-table basis using CQL to alter a table.