# Tuple Structure
A **Tuple** (or Heap Tuple) is the physical representation of a row in a PostgreSQL heap. It contains the user data along with essential metadata for concurrency and visibility.
For the narrative explanation of this concept, see [[Chapter 1/1.2 - The Physical Suitcase (The Tuple)|1.1 The Tuple (The Physical Suitcase)]].
## Internal Anatomy
A tuple consists of three main parts:
### 1. HeapTupleHeaderData (23 bytes)
The fixed-size header containing visibility information:
- **t_xmin**: The Transaction ID (XID) that inserted the tuple.
- **t_xmax**: The XID that deleted or locked the tuple (zero if not deleted).
- **t_cid**: The Command ID within the transaction.
- **t_ctid**: The physical location (Page, Offset) of this tuple or its updated version.
- **t_infomask**: Bitflags describing commit/abort status and tuple properties (e.g., has nulls, has TOAST).
### 2. Null Bitmap
An optional bit array indicating which columns are NULL. If a bit is 0, the column is NULL and no space is allocated for it in the data area.
### 3. User Data
The actual values for the columns.
- **Alignment**: Data is aligned to 8-byte boundaries. This can lead to internal padding if the schema is not optimized.
- **TOAST**: If a field is too large (> 2KB), it is moved to a separate TOAST table, leaving a 20-byte "pointer" in the original tuple.
## See Also
- [[Architecture/MVCC|MVCC]]
- [[Structures/Page|Page Structure]]
- [[Structures/Table|Table Access Methods]]