JSON Data Type | Create Join Index with JSON | Teradata Vantage - Creating a Join Index With a JSON Type - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
gzn1554761068186.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantageā„¢

When the inline length is equal to the maximum length, the JSON type is treated as a non-LOB type. In this case, the non-LOB JSON type can be part of a join index. However, it cannot be part of the primary index of the join index.

For example:

CREATE TABLE jsonTable (id INTEGER,
   /* non-LOB */        jsn1 JSON(1000) CHARACTER SET LATIN,
   /* LOB */            jsn2 JSON(1M) INLINE LENGTH 30000 CHARACTER SET LATIN);

The following statement successfully creates a join index:

CREATE JOIN INDEX jsonJI AS SELECT id, jsn1 FROM jsonTable;

The following statement fails because LOB types cannot be part of an index:

CREATE JOIN INDEX jsonJI AS SELECT id, jsn2 FROM jsonTable;
*** Failure 5771 Index not supported by UDT 'TD_JSONLATIN_LOB'. Indexes are not supported for LOB UDTs.

You can also create a join index that contains extracted portions of a JSON instance. You can do this with non-LOB and LOB JSON types.

Use the following to extract portions of the JSON data:
  • JSON dot notation syntax
  • JSONExtractValue or JSONExtractLargeValue methods