[prev] 49 [next]

PostgreSQL Page Representation (cont)

Operations on Pages:

void PageInit(Page page, Size pageSize, ...)

  • initialize a Page buffer to empty page
  • in particular, sets pd_lower and pd_upper
OffsetNumber PageAddItem(Page page,
                    Item item, Size size, ...)
  • insert one tuple (or index entry) into a Page
  • fails if: not enough free space, too many tuples
void PageRepairFragmentation(Page page)
  • compact tuple storage to give one large free space region