Glossary — in plain language

Tuple deforming

Also called: heap_deform_tuple, tuple unpacking, column extraction

In plain English

Deforming is the process of turning a packed on-disk row (a byte string with a header, optional NULL bitmap, and padded column values) back into usable column values. PostgreSQL walks the tuple left to right in heap_deform_tuple(), applying each type’s alignment, and fills two arrays: values[] (the Datums) and isnull[].

Why it matters

Almost every row PostgreSQL processes is deformed, so it is a genuine hot path. The executor deforms lazily — only up to the highest column a query references — which is why selecting a late column (after a variable-length or NULL column) costs more than selecting an early one.

Was this helpful?

← Browse the full glossary