Array Data Types - Advanced SQL Engine - Teradata Database

Database Design

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

The storage size of an ARRAY/VARRAY depends on how it is defined.

Field Description Size (bytes)
Flag bits Used to configure the layout of the field.

Bit 0: variable offset size.

  • If 0, the variable offsets are 2 bytes each.
  • If 1, the variable offsets are 4 bytes each.

Bits 1 - 15: unused

2
Last present element Index of the last present element in the array. This consists of 1 to number_of_dimensions integer values, one for each dimension.

The index values are 0-based.

If the array has uninitialized elements, the index values are equal to -1.

4 x number_of_dimensions
Presence bit array Presence bit array for the array elements.

A variable length byte array with 1 bit per element laid out in row major order.

0 means the element is null.

1 means the element is not null.



Variable offset array
  • If the element type is a variable length type, an offset array is used to index into the element data.

    The offset array is the same as the offset array in the table row.

  • If the element type is fixed length, the variable offset array is omitted.
2 x number_of_elements

or

4 x number_of_elements

Element value array All elements are stored in row major order.

Variable length elements are stored in their actual size.

number_of_elements x element_size