16.20 - Truncation and Performance - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
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 Teradata Database must create a temporary BLOB and perform a data copy. Because Teradata Database 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.