Skip to content
Opensource internals
  • Posts

Performance

PostgreSQL Speeds Up Hash Joins: Specialising the Expression Interpreter

Oct 11, 2026 31 min read Jay Hubbert

PostgreSQL pattern-matches a hash join’s compiled expression steps and swaps the general-purpose interpreter for a specialised C function, which is worth up to 20% on probe-heavy …

PostgresPerformanceExecutorInternals

Read more →

PostgreSQL Waits for Locks: The Spin, Sleep, and Kernel Ladder

Oct 6, 2026 49 min read Jay Hubbert

PostgreSQL’s wait ladder spins in user space, then backs off with a jittered exponential delay so spinners don’t convoy, and only then blocks in the kernel — and it learns how long …

PostgresPerformanceConcurrencyInternals

Read more →

PostgreSQL Locks Buffers Without LWLocks: One 64-Bit Word

Oct 2, 2026 43 min read Jay Hubbert

PostgreSQL 20 moved buffer content locks out of the LWLock machinery and into the buffer’s own 64-bit state word, so taking one costs a single compare-and-swap.

PostgresPerformanceStorageConcurrencyInternals

Read more →

PostgreSQL Allocates Memory Fast: Size Classes, Freelists, and Context Recycling

Sep 19, 2026 40 min read Jay Hubbert

palloc quantises sizes to powers of two, keeps eleven freelists, carves dying blocks into reusable chunks, and recycles memory contexts so a per-tuple context costs zero mallocs.

PostgresPerformanceMemoryInternals

Read more →

PostgreSQL Groups Commits: How a Hundred Backends Share One fsync

Sep 12, 2026 50 min read Jay Hubbert

Committing doesn’t fsync: backends copy WAL into shared memory and piggyback on one fsync, using LWLockAcquireOrWait so followers can observe someone else’s flush without ever …

PostgresPerformanceWalInternals

Read more →

← Newer Page 19 of 23 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·