Truncation and Performance | Functions That Use LOB Types | Teradata Vantage - 17.10 - Truncation and Performance - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Consider a UDF that declares a BLOB(100000) AS LOCATOR parameter. If you call the UDF and pass in a BLOB(200000) column, truncation might occur, so Vantage must create a temporary BLOB and perform a data copy. Because Vantage stores the temporary BLOB on disk, the performance cost of the conversion is significant.

A solution is to omit the size of the BLOB argument in the function declaration, and use the default size, which is 2,097,088,000 bytes, the maximum size of a LOB.