15.00 - Array Data Types - Teradata Database

Teradata Database Design

Teradata Database
User Guide

Array Data Types

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




                   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


    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.

    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.
  • or

    Element value array

    All elements are stored in row major order.

    Variable length elements are stored in their actual size.