PostgreSQL Defers and Speeds Up Tuple Deformation: Cached Offsets in TupleDesc
TupleDesc now caches the byte offset of every fixed-width attribute, so fetching column 40 of a wide table can cost one addition instead of a full re-walk.
TupleDesc now caches the byte offset of every fixed-width attribute, so fetching column 40 of a wide table can cost one addition instead of a full re-walk.
A date is an int32 count of days since 2000-01-01 — which is why ordering is free, why ‘infinity’ is literally INT32_MAX, and why the calendar costs you nothing at query time.
PostgreSQL’s sorter attacks three problems at once: abbreviated keys make string comparisons into integer compares, a radix sort handles integer keys, and a bounded heap makes …
inet and cidr share one 18-byte struct with the mask length stored inside the value; the whole difference between a host address and a network is one input check.
PostgreSQL 18’s skip scan lets an index on (a, b) answer a query on b alone by procedurally generating the possible a values at scan time.