Algorithmic Compression (ALC) | Data Types and Literals | Teradata Vantage - Algorithmic Compression (ALC) - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.

Use ALC 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