15.00 - Autocompression - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Autocompression

The term autocompression refers to a set of compression methods that Teradata Database can apply to a container of a column‑partitioned table or join index that has COLUMN format if you do not specify the NO AUTO COMPRESS option for the container when you create the table or join index. All of the compression methods that Teradata Database uses to autocompress container data are lossless. Autocompression is most effective for a column partition with a single column and COLUMN format.

Teradata Database determines how to autocompress a physical row on either a row‑by‑row basis or on an a priori basis, including not applying autocompression techniques or user‑specified compression to one physical row or any physical rows in a column partition.

If the autocompression techniques chosen for a physical row do not reduce the size of the physical row, Teradata Database does not compress the physical row. Similarly, when there is no autocompression technique that reduces the size of the physical row, Teradata Database does not compress the values for that physical row.

Teradata Database appends column partition values to a container without any autocompression until the container is full. Only then is the form of autocompression for the container determined and the compression applied to the container data. Teradata Database appends any column partitions values added at a later time using the existing form of autocompression until the container is again full. When you add more column partition values to the column partition, another container is started and the process repeats.

Note that a container might use the compression techniques of the preceding container when Teradata Database decides to do so. Whether to reuse the autocompression techniques of the preceding container or to use a specific set of autocompression techniques for the current container is determined automatically by Teradata Database. Reusing the autocompression that was used for the preceding cylinder can improve the performance of INSERT … SELECT requests by avoiding the determination of a specific set of autocompression techniques for each container when Teradata Database thinks it is unnecessary because the compression techniques used by the preceding container are anticipated to match what would be used anyway. In such cases, Teradata Database can just reuse the set of compression techniques used by the preceding container.

Teradata Database determines whether to apply both autocompression and user‑specified multi‑value and algorithmic compression to a column, and if the user‑specified methods do not help to compress a container, the system only applies autocompression.

If you want to ensure that the null compression, multi‑value compression, or algorithmic compression you specify is used for a column partition, specify NO AUTO COMPRESS for that partition.

If a container has autocompression, it uses several overhead bytes in the row header as an offset to compression bits, to indicate the autocompression types and their arguments for the container, autocompression bits, for a local value-list dictionary, and for present column partition values. If the container does not have autocompression, it uses 0 or more bytes for present column partition values.

Note: You can apply autocompression to row‑level security‑protected columns.

See “Autocompression” on page 300 for more information about autocompression.