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

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

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.