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 to false.

    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 algorithm class to LZ4Compressor, SnappyCompressor, or DeflateCompressor.

    CREATE TABLE DogTypes (
        WITH compression = { 'class' : 'LZ4Compressor' };
  • Change compression on an existing table, using ALTER TABLE and setting the compression algorithm class to DeflateCompressor.

    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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com