Inside PostgreSQL Shared Memory
summary
Explains concrete internals: data files live on the file system, rows packed into 8k pages with headers item pointers and a null bitmap (t‑bits), and primary types stored in native CPU formats (timestamps as 64‑bit). Memory uses a shared segment for the shared buffers cache (SysV POSIX or mmap since Postgres 9-3), processes fork from a postmaster and access the same buffers, dirty pages are written by background writer/checkpoint, and short locks use a test and set spinlock with semaphore sleep fallback.
AI-written summary · about
chapters (13)
- 0:00Start
- 7:55File System/database/db
- 11:28File System Block Tuple
- 12:51Tuple Header C Structures
- 21:06Shared Memory Creation
- 25:10Shared Buffers
- 28:59Finding A Tuple Value in C
- 30:22Value Access in C
- 43:36Test And Set Lock x86 Assembler
- 43:53Spin Lock Always Succeeds
- 44:39Light Weight Locks
- 44:56Database Object Locks
- 45:34Other Shared Memory Structures
related talks
39mPostgreSQL: Page Buffer Overview
45mEnhancing PostgreSQL Plasticity: New Frontiers in Memory Management
30mPostgreSQL and Linux Kernel interactions
32mDesigning and implementing a monitoring feature in PostgreSQL
41mLinux IO internals for PostgreSQL administrators in 2023
26mLinux and PostgreSQL in the Multiverse of Connections
49mHow Databases Work - For Developers, Accidental DBA's and Managers
52mMulti-threaded PostgreSQL?
