16.10 - Array Data Types - Teradata Database

Teradata Database Design

Product
Teradata Database
Release Number
16.10
Release Date
June 2017
Content Type
User Guide
Publication ID
B035-1094-161K
Language
English (United States)

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