All Products
Search
Document Center

PolarDB:Heap table structure

Last Updated:Mar 28, 2026

PolarDB for PostgreSQL (Compatible with Oracle) stores table data in heap files. Each table maps to one or more data files on disk, organized as a hierarchy of pages and tuples.

Heap table structure

Storage hierarchy

ItemDescription
table filesOne or more data files that together make up a table. A new data file is created when a data file exceeds 1 GB.
fileA data file that contains multiple pages.
pageA fixed-size block (also called a data block) that contains multiple tuples.
page headerMetadata at the start of each page. See Page header fields.
tupleA row version. In a multiversion concurrency control (MVCC) context, a single logical row can have multiple tuple versions.
tuple headerMetadata at the start of each tuple that stores MVCC control information. See Tuple header fields.

Page header fields

The PageHeaderData structure contains the following fields.

FieldDescription
pd_lsnThe log sequence number (LSN) of the last write-ahead logging (WAL) record that modified this page.
pd_checksumThe page checksum.
pd_flagsFlag bits.
pd_lowerOffset from the page start to the end of the line pointer array. This marks the start of free space. Line pointers grow from this boundary toward the end of the page.
pd_upperOffset from the page start to the start of the heap tuple area. This marks the end of free space. Tuples are stored from this boundary backward toward the header.
pd_specialOffset from the page start to the beginning of special space.
pd_pagesize_versionThe page size and layout version number.
pd_prune_xidThe earliest XMAX that is not deleted from the page. If none exists, the value is 0.

Tuple header fields

The HeapTupleHeaderData structure contains the following fields.

FieldDescription
t_xminThe XID of the transaction that inserted this tuple.
t_xmaxThe XID of the transaction that deleted this tuple.
t_cidThe command ID (CID) of the INSERT or DELETE command within the inserting transaction. For example, in a transaction that runs three INSERT statements sequentially, the first statement sets t_cid to 0, the second to 1, and so on.
t_ctidThe tuple ID (TID) of this tuple or a later version of the same row. Points to the current tuple if no newer version exists.
t_infomaskFlag bits.
t_infomask2Extra flag bits.
t_hoffOffset from the tuple start to the actual user data.
tuple dataThe actual column values stored in the tuple.