Skip to content
Opensource internals
  • Posts

Postgres

PostgreSQL Defers and Speeds Up Tuple Deformation: Cached Offsets in TupleDesc

Jul 28, 2026 36 min read Jay Hubbert

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.

PostgresPerformanceStorageInternals

Read more →

PostgreSQL's date Implementation in C: Days Since 2000, Stored as an int32

Jul 27, 2026 6 min read Jay Hubbert

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.

PostgresInternalsDate

Read more →

PostgreSQL Sorts Rows Fast: Abbreviated Keys, Radix Sort, and Top-N Heaps

Jul 25, 2026 45 min read Jay Hubbert

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 …

PostgresPerformanceSortInternals

Read more →

PostgreSQL's inet and cidr Implementation in C: One Value, Two Policies

Jul 24, 2026 9 min read Jay Hubbert

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.

PostgresInternalsInetCIDR

Read more →

PostgreSQL Skip Scans B-Tree Indexes: Reading a Non-Leading Column

Jul 22, 2026 33 min read Jay Hubbert

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.

PostgresPerformanceBtreeIndexInternals

Read more →

← Newer Page 7 of 7 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·