16.20 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

Advanced SQL Engine
Teradata Database
Release Number
April 2020
Content Type
Programming Reference
Publication ID
English (United States)
Last Update

TransUnicodeToUTF8 compresses the specified Unicode character data into UTF8 format, and returns the compressed result. This is useful when the input data is predominantly Latin characters because UTF8 uses one byte to represent Latin characters and Unicode uses 2 bytes.

TransUnicodeToUTF8 provides good compression for Unicode strings of any length and is best used:

  • On a Unicode column that contains mostly US-ASCII characters
  • When the data frequently switches between:
    • Uppercase and lowercase letters
    • Digits and letters
    • Latin and non-Latin characters
  • When the data is very dynamic (under frequent update)

Although you can call the function directly, TransUnicodeToUTF8 is normally used with algorithmic compression (ALC) to compress table columns. If TransUnicodeToUTF8 is used with ALC, nulls are also compressed if those columns are nullable.