AWS Redshift – Choosing a Column Compression Type

Updated: Aug 16, 2019

Choosing a Column Compression Type

• Columnar compression delivers increased performance and lower cost

• The “COPY” command automatically analyzes and compresses data when loading into empty tables

• The “ANALYZE COMPRESSION” command checks existing tables and proposes optimal compression algorithms for each column

• You can query system tables for storage utilization

• You cannot change the compression encoding for a column after the table is created

• You can specify the encoding for a column when it is added to a table using the ALTER TABLE command

Be Careful When Compressing Your Sort Keys

Zone maps store min/max per block

• After we know which block(s) contain the range, we know which row offsets to scan

• Highly compressed sort keys means many rows per block

• You’ll scan more data blocks than you need

• If your sort keys compress significantly more than your data columns, you may want to skip compression of sortkey column(s)

• Check SVV_TABLE_INFO(skew_sortkey1)

©2019 by Raghavendra Kambhampati