17.00 - COMPRESS - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

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 Teradata Vantage™ - Database Design, B035-1094.
For more information about the COMPRESS attribute, see Teradata Vantage™ - Data Types and Literals, B035-1143.

constant
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 Teradata Vantage™ - Data Types and Literals, B035-1143 for information about limits for this value.
NULL
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.