A compression encoding specifies the type of compression that is applied to a column of data values as rows are added to a table.
If no compression is specified in a CREATE TABLE or ALTER TABLE statement, Amazon Redshift automatically assigns compression encoding as follows:
Columns that are defined as sort keys are assigned RAW compression.
Columns that are defined as BOOLEAN, REAL, or DOUBLE PRECISION data types are assigned RAW compression.
All other columns are assigned LZO compression.
The following table identifies the supported compression encodings and the data types that support the encoding.
|Encoding type||Keyword in CREATE TABLE and ALTER TABLE||Data types|
|Raw (no compression)||RAW||All|
|Byte dictionary||BYTEDICT||All except BOOLEAN|
SMALLINT, INT, BIGINT, DATE, TIMESTAMP, DECIMAL
INT, BIGINT, DATE, TIMESTAMP, DECIMAL
|LZO||LZO||All except BOOLEAN, REAL, and DOUBLE PRECISION|
SMALLINT, INT, BIGINT, DECIMAL
INT, BIGINT, DECIMAL