Guidelines for Using Row Compression with Join Index Columns - 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

A column set with a high number of distinct values cannot be row-compressed because the values rarely repeat (and in the case of a primary key, the values never repeat). Column sets such as foreign key and status code columns repeat values frequently. Row compression capitalizes on the redundancy of frequently repeating column values by storing each unique value once in the fixed part of the index row with multiple repeated values in the repeated part of the index row.

Typically, primary key table column values are specified as the repeating part and foreign key table columns are specified in the fixed part of the index definition.

Using Outer Joins to Define Join Indexes and Example: Creating Join Indexes Using Outer Joins are examples of how you can use row compression to take advantage of repeated column values.

A row-compressed join index may be used for a query when the join index would be used if it were not row compressed. Check the EXPLAIN for a query to see if join indexes are being used.