15.00 - Row Components - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Row Components

The following table describes the individual components of a Teradata Database base table row for both packed64 systems and aligned row systems:

 

          Component

 Number of Bytes

                                                     Description

Reference array pointer

               2

The reference array pointer is not part of the physical row. It is a 2‑byte entry maintained at the bottom of each data block that points to the first byte of each row in the block.

 

                                                                                        Row Header

Row length

               2

Specifies the exact length of the row in bytes.

Nonpartitioned Primary Index RowID

               8

Contains two physical fields and one virtual field:

  • Partition number:
  • Implicitly assumed to have a value of 0 (as indicated by 2 bits in the flag byte).
  • Consumes 0 bytes from the row.
  • Row hash value
  • Uniqueness value
  •      Row hash

                    4

    Contains the hashing algorithm‑generated row hash value for the row.

    The value is 4 bytes wide irrespective of the number of hash buckets the system has (see “Teradata Database Hashing Algorithm” on page 225).

         Uniqueness value

                    4

    Contains the system-generated uniqueness value for the row.

         Internal partition
         number

                    0

    This field is logical, not physical.

    It is not stored as a physical value because its value is known to the system always to be 0.

    PPI RowID

              10 or 16

    Contains these physical fields:

  • Partition number:
  • Contains a value between 1 and 65,535 or big number that defines the internal partition number for the row.
  • Consumes 2 or 8 bytes from the row.
  • Row hash value.
  • Uniqueness value.
  • Note that the partition number field is not contiguous with the row hash and uniqueness value fields; instead, it immediately follows the first byte of the presence bits array.

         Row hash

                     4

    Contains the hashing algorithm‑generated row hash value for the row.

    The value is 4 bytes wide irrespective of the number of hash buckets the system has (see “Teradata Database Hashing Algorithm” on page 225).

         Uniqueness value

                     4

    Contains the system-generated uniqueness value for the row.

         Internal partition
         number

                2 or 8

    Contains the partition number for a row in a PPI table.

  • If the maximum partition is  65,535, partition number is 2 bytes.
  • If the maximum partition is > 65,535, partition number is 8 bytes.
  • If the row does not belong to a PPI table, then this field is logical only, and its value is 0.
  • Flag byte

                   1

    Defines whether the 4-byte Partition number field is used or not.

  • If the flag is set, the row is from a PPI table and the row header uses the 4-byte partition number field that follows the first presence octet to store its partition number.
  • If the flag is not set, the row is not from a PPI table and the system assumes that the partition number for the rowID is 0.
  •                                                                                    Presence Bits Array

    First byte of the presence bit array

    See “Presence Bits” on page 780 for more information.

                   1

    If the table has a PPI, there is an additional 2 or 8 byte overhead in the presence bits array.

    Defines column nullability and compressibility.

    Additional bytes of presence bit arrays

    8 bytes per presence bit array.

    Provides additional space to define nullability and compressibility for columns if the first presence bit array is too small to contain all the information for the table.

    For more information, see “Presence Bits” on page 780.

                                                                                      VARCHAR Offset Array

    Offset array pad bytes

    The array pad bytes are only used for aligned row format systems.

    Varies

    Aligns the offset array at a 2‑byte boundary.

    This component exists for rows on aligned row systems only.

    Column offsets

    Varies

    2 bytes per variable length column.

    Only present when variable length columns are defined for a table.

    Indicates the intrarow location of the column it references.

                                                                                        Fixed Length Columns

    Fixed length column pad bytesb

    Varies

    Aligns the fixed length columns on an 8‑byte boundary.

    This component exists for rows on aligned row systems only.

    Fixed length columns

    Varies

    Contains all non-compressible fixed length columns.

                                                                                      Compress Length Columns

    Compressible column pad bytesb

    Varies

    Aligns the value compressible columns on an 8‑byte boundary.

    This component exists for rows on aligned row systems only.

    Compressible columns

    Varies

    Contains compressible columns with data belonging to one of four categories:

  • Not compressed using multi-value compression.
  • Not compressed using algorithmic compression.
  • Compressed using algorithmic compression.
  • Compressible data that is not null.
  •                                                                              Variable-Length (VARCHAR and VARBYTE) Columns

    Variable length column pad bytesb

    Varies

    Aligns the variable-length columns on an 8‑byte boundary.

    This component exists for rows on aligned row format systems only.

    VARCHAR and VARBYTE columns

    Varies

    Only present when variable-length columns are defined for a table.

    Contains all variable length character columns. The column offsets field points to the starting location for each variable length column in the row.

                                                                                                  Row Trailer

    Trailing pad bytes

    Varies

    Aligns the row on an even‑byte boundary for packed64 format systems or on an 8‑byte boundary for aligned row systems.