17.05 - COMPRESS USING - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Advanced SQL Engine
Teradata Database
Release Number
Release Date
January 2021
Content Type
Programming Reference
Publication ID
English (United States)

Algorithmic compression (ALC) for a column.

For a list of data types that can be algorithmically compressed, see the COMPRESS and DECOMPRESS phrases in Teradata Vantage™ - Data Types and Literals, B035-1143.

You can also specify COMPRESS USING for a column in a volatile table. To specify COMPRESS USING compress_UDF_name, the table cannot be populated with rows. If you specify COMPRESS USING, you must also specify DECOMPRESS USING. The COMPRESS USING and DECOMPRESS USING options can be specified in either order. When you specify algorithmic compression, the data is compressed, if possible, to a smaller amount of space than it currently requires. You can specify multivalue compression and algorithmic compression for the same column. Algorithmic compression is only applied to values that are not specified for multivalue compression. For a column-partitioned table, the column partition that includes the column can have autocompression. You can combine multivalue compression, algorithmic compression, autocompression (for a column-partitioned table), and block-level compression for the same table to achieve better compression, but as a general rule you should not use algorithmic compression with block-level compression because of the possibility of a negative performance impact for other workloads. Teradata provides external UDFs for algorithmic compression and decompression. See the compression and decompression functions in Teradata Vantage™ - SQL Operators and User-Defined Functions, B035-1210.

Name of the UDF to algorithmically compress data in this column. The default containing database for compress_UDF_name is SYSUDTLIB. If compress_UDF_name is an embedded services UDF, then its default containing database is TD_SYSFNLIB. If compress_UDF_name is not contained in SYSUDTLIB or TD_SYSFNLIB, the system returns an error to the requestor.