15.10 - COMPRESS - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Teradata Database
December 2015
Programming Reference

Use multivalue compression (MVC) for a set of distinct values in the column. You can also specify COMPRESS for a column in a volatile table. The default is to compress nulls only. You can specify multivalue and algorithmic compression in either order. For a detailed description of multivalue compression, see Database Design, B035-1094.
For more information about the COMPRESS attribute, see SQL Data Types and Literals, B035-1143.

Nulls and the specified constant values are compressed. You cannot compress nulls and constants if the column is defined as NOT NULL. Using COMPRESS on data can save space depending on the percentage of rows for which the compressed value is assigned. You can specify multivalue compression for all numeric types, BYTE, VARBYTE, DATE, CHARACTER, VARCHAR, GRAPHIC, VARGRAPHIC, TIME, TIME WITH TIME ZONE, TIMESTAMP, or TIMESTAMP WITH TIME ZONE data types. See SQL Data Types and Literals, B035-1143 for information about limits for this value.
Nulls are compressed for the column. The following rules apply:
  • You cannot specify NULL if the column is defined as NOT NULL.
  • LOB-based UDT nulls cannot be compressed.
  • You can only specify NULL once per column.