Indexes (B-tree)

Page split (B-tree)

Also called: leaf split, _bt_split, node split

A page split happens when an insert lands on a B-tree page that is already full. PostgreSQL (_bt_split() in nbtinsert.c) allocates a new page, moves part of the entries to it, rewires the sibling links, and posts a new pointer (downlink) up to the parent. If the parent is full too, the split cascades upward, and at the top it can create a whole new root.

What this means

When an insert lands on a B-tree page that's already full, Postgres makes room by splitting it: it allocates a new page, moves half the entries over, re-wires the sibling links, and posts a pointer to the new page up to the parent. If the parent is full too the split ripples upward, and at the very top it can grow a whole new root.

Why it matters operationally

Splits are how a B-tree grows, but they are also work and a source of bloat. Random-insert keys split ~50/50; monotonically increasing keys split ~90/10 at the right edge, which packs tightly but concentrates activity on one hot page. Tuning fillfactor and using deduplication both aim to delay splits.

← All glossary terms · GUC reference · Error catalog