taco-db  0.1.0
Public Attributes | List of all members
taco::VarlenDataPageHeader Struct Reference

The page header of a variable-length record data page. More...

Public Attributes

PageHeaderData m_ph
 The file manager managed page header. Do not modify. More...
 
FieldOffset m_ph_sz
 The size of the header including the user data area. More...
 
FieldOffset m_fs_begin
 The offset to the beginning of the free space. More...
 
bool m_has_hole: 1
 Whether there might be some free space among the occupied space after the last compaction. More...
 
bool __pad0__: 1
 
SlotId m_cnt: 14
 Number of items on this page. More...
 
SlotId __pad1__:2
 
SlotId m_nslots: 14
 Number of slots in the slot array. More...
 

Detailed Description

The page header of a variable-length record data page.

Its layout is as follows: | header | occupied space | free space | slot array | | fixedhdr | usrdata | (maybe holes ^ ^ ^ ^ ^ in middle) | | | | | | | PAGE_SIZE VarlenDataPageHeaderSize | | | | | | m_fs_begin | ph->m_ph_sz (maxaligned) | PAGE_SIZE - sizeof(SlotData) * m_nslots

The slot array grows backwards (from high address to low). The slot for slot ‘sid’ can be indexed by slot_array_end[-(int)sid], where slot_array_end = (SlotData*)(page_pointer + PAGE_SIZE).

Member Data Documentation

◆ __pad0__

bool taco::VarlenDataPageHeader::__pad0__

◆ __pad1__

SlotId taco::VarlenDataPageHeader::__pad1__

◆ m_cnt

SlotId taco::VarlenDataPageHeader::m_cnt

Number of items on this page.

◆ m_fs_begin

FieldOffset taco::VarlenDataPageHeader::m_fs_begin

The offset to the beginning of the free space.

◆ m_has_hole

bool taco::VarlenDataPageHeader::m_has_hole

Whether there might be some free space among the occupied space after the last compaction.

It can be an approximation but setting it to true too aggresively may result in too many space compaction calls.

◆ m_nslots

SlotId taco::VarlenDataPageHeader::m_nslots

Number of slots in the slot array.

◆ m_ph

PageHeaderData taco::VarlenDataPageHeader::m_ph

The file manager managed page header. Do not modify.

◆ m_ph_sz

FieldOffset taco::VarlenDataPageHeader::m_ph_sz

The size of the header including the user data area.


The documentation for this struct was generated from the following file: