COMPRESS USING - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

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.

compress_UDF_name
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.