Storage & tuples

attcacheoff (cached attribute offset)

Also called: cached column offset, attribute offset cache

attcacheoff is a cached byte offset for a column within a row. If every column before it is fixed-width and NOT NULL, that column always sits at the same offset, so PostgreSQL stores it once and jumps straight there, O(1) access during deforming, no need to walk the earlier columns.

What this means

A cached shortcut to a column's position in the row. If every column before it is fixed-width and NOT NULL, that column always sits at the exact same byte offset, so Postgres works it out once and jumps straight there next time, instead of re-walking all the earlier columns to find it.

Why it matters operationally

The shortcut works only up to the first variable-length column or the first NULL; after that, offsets depend on the actual data and must be computed by sequential deforming. This is the mechanism behind a practical rule: keep frequently-read, fixed-width columns early in the table so they stay cheap to reach.

← All glossary terms · GUC reference · Error catalog