Multivalue Compression Procedure - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
  1. Use the COMPRESS phrase in a CREATE TABLE or ALTER TABLE statement to specify a list of frequently occurring values for the column that contains the values, for example:
    CREATE TABLE Employee
       (EmpNo INT NOT NULL,
        EmpLoc CHAR(30) COMPRESS ('Seattle','Dallas','Chicago')
    ...
        DOB DATE COMPRESS (DATE '1972-02-29', DATE '1976-02-29')
    ...);
  2. The system compresses the specified values when data moves into the table, and uncompresses the values when the containing rows are accessed.
  • The system automatically compresses NULLs when you specify COMPRESS.
  • Compressing values in a table can cause the dictionary cache to overflow. If this happens increase your dictionary cache to the default value of 1 MB.
  • You cannot apply MVC to row-level security columns.

You can use MVC to compress columns with these data types:

  • Any numeric data type
  • BYTE
  • VARBYTE
  • CHARACTER
  • VARCHAR
  • DATE

    To compress a DATE value, you must specify the value as a Date literal using the ANSI DATE format (DATE 'YYYY-MM-DD'). For example:

        COMPRESS (DATE '2000-06-15')
       
  • TIME and TIME WITH TIME ZONE
  • TIMESTAMP and TIMESTAMP WITH TIME ZONE

To compress a TIME or TIMESTAMP value, you must specify the value as a TIME or TIMESTAMP literal. For example:

   COMPRESS (TIME '15:30:00')
   COMPRESS (TIMESTAMP '2006-11-23 15:30:23')
You can also use COMPRESS (NULL) for columns with these data types:
  • ARRAY
  • Period