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

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
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.