Posted On: Oct 20, 2020
Amazon Redshift now allows users to modify the compression encoding of existing columns with a single statement. This new capability makes it easier to maintain the optimal compression encodings in Amazon Redshift to achieve high performance and reduce the storage utilization.
A compression encoding specifies the type of compression that is applied to data values in a column as rows are added to a table. Choosing the right encoding reduces the storage utilization of a column while improving the performance of queries that access the column. You can use CREATE TABLE or ALTER TABLE statements to specify compression encodings for columns when creating a table. If no compression is specified, Amazon Redshift automatically assigns default compression encodings based on table data.
This release will make is easier to get the benefits of Amazon Redshift compression technologies like AZ64, a new compression encoding that consumes 5-10% less storage than ZSTD and enables queries to run 70% faster. Previously, customers who wanted to take advantage of new encoding algorithms such as AZ64 needed to recreate the entire table. Since Redshift recommends that columns defined as SORT keys should not be compressed, previously customers who apply sort keys to existing tables needed to recreate the entire table. With the new ability to modify column compression encodings this process is faster and easier and doesn't impact user access to tables.
With the new ALTER TABLE <tbl> ALTER COLUMN <col> ENCODE <enc> command, users can dynamically change Redshift table compression encodings. Redshift will take care of adjusting data compression behind the scenes and the table remains available for users to query. Users can modify column encodings for a given table as many times as needed and they can alter encoding for multiple tables simultaneously.
For more information ALTER TABLE ENCODING, please refer to the documentation.
This feature is available in Redshift 1.0.19506 and later. Refer to the AWS Region Table for Amazon Redshift availability.