Ora

How big is Teradata timestamp?

Published in Teradata Data Types 2 mins read

A Teradata TIMESTAMP data type primarily occupies 10 bytes of storage. This represents its Packed64 Size, which is the actual physical space required to store the timestamp value, encompassing date, time, and up to six digits of fractional seconds precision.

Teradata also specifies an "Aligned Row Size" for the TIMESTAMP data type, which is 4 bytes. This typically relates to how the data is handled within a row's internal structure for memory alignment and processing efficiency within the Teradata database system. While the actual data value requires 10 bytes for complete storage, the Aligned Row Size indicates the space it occupies within the row structure for internal optimization.

Teradata DateTime Data Type Storage Sizes

To provide a comprehensive view, here's a comparison of common date and time data types and their respective storage sizes within Teradata, detailing both their Packed64 Size and Aligned Row Size:

Data Type Packed64 Size (bytes) Aligned Row Size (bytes)
DATE 4 4
TIME 6 4
TIMESTAMP 10 4
TIME WITH TIME ZONE 8 4

Understanding Teradata Timestamp Storage

  • Packed64 Size (10 Bytes): This is the fundamental size needed to store the full TIMESTAMP value. It encompasses the year, month, day, hour, minute, second, and up to six digits of fractional seconds (microseconds). This default precision (TIMESTAMP(6)) is common in Teradata if no explicit precision is specified.
  • Aligned Row Size (4 Bytes): This metric is related to Teradata's internal data storage optimization and how fixed-length or pointer-sized components are managed within a table's row structure. While the data itself is 10 bytes, its representation or a pointer to it within the aligned row might be 4 bytes, allowing for efficient processing and memory management.

Choosing the appropriate data type, such as DATE, TIME, or TIMESTAMP, is crucial for efficient database design. This decision directly impacts storage consumption and query performance. For instance, if only date information is required, using a DATE type (4 bytes) is more efficient than a TIMESTAMP (10 bytes). Further details on Teradata's data types and capacity planning can be found in the official DateTime Data Types documentation.