16.20.16.20 - 16.20 - Algorithmic Compression (ALC) - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

In some cases, such as when column values are mostly unique, algorithmic compression can provide better compression results than multi-value compression. Algorithmic compression allows you to define your own compression and decompression algorithms and apply them to data at the column level.

You implement the algorithms as external C/C++ scalar UDFs, and then specify them in the column definition of a CREATE TABLE/ALTER TABLE statement. Teradata Database invokes these algorithms to compress and uncompress the column data when the data is moved into the tables or when data is retrieved from the tables.

ALC allows you to implement the compression scheme that is most suitable for data in a particular column. The cost of compression and uncompression depends on the algorithm chosen.

You can specify ALC alone, or both MVC and ALC on the same column. If you define both on the same column, ALC is applied only to those non-null values that are not specified in the value compression list of the MVC specification.

Using ALC together with block-level compression (BLC) may degrade performance, so this practice is not recommended.
You can use algorithmic compression to compress table columns with the following data types:
  • ARRAY
  • BYTE
  • VARBYTE
  • BLOB
  • CHARACTER
  • VARCHAR
  • CLOB
  • JSON, with some restrictions listed below
  • TIME and TIME WITH TIME ZONE
  • TIMESTAMP and TIMESTAMP WITH TIME ZONE
  • Period types
  • Distinct UDTs, with some restrictions listed below
  • System-defined UDTs, with some restrictions listed below