Database Internals: Page Layout Explained (based on PostgreSQL)

Publicado em: 09 Dezembro 2025
no canal de: Data Craze
372
17

Ever wondered what actually happens on disk when you run an INSERT command?

It’s not magic. It’s engineering. And understanding it is the difference between a "database user" and a "database engineer".

In this video, we leave the SQL layer behind and dive deep into the physical storage of PostgreSQL. We’ll look at the famous 8KB page, see how tuples are arranged like a game of Tetris, and meet the silent heroes responsible for performance: FSM and VM.

TIMELINE:
00:00:00 Intro
00:00:23 Welcome
00:01:19 PGDATA
00:03:08 Main Table File
00:04:21 Free Space Map
00:05:19 Visibility Map
00:06:25 Initialization Fork
00:07:50 Page Layout
00:11:17 SQL Examples
00:16:26 Summary

SUMMARY:
👉 Pages are fixed-size: PostgreSQL typically uses 8KB pages. Your rows (tuples) must fit in here, or special mechanisms kick in.
👉 The "Tetris" of Storage: Items (row data) grow from the end of the page backwards, while pointers grow from the start. The empty space in the middle where the battle for efficiency happens.
👉 FSM & VM are critical: The Free Space Map prevents slow full-table scans during inserts, while the Visibility Map powers the ultra-fast Index-Only Scans.

RESOURCES:
📝 Full Article: https://datacraze.io/database-file-la...
📩 Data Craze Newsletter: https://datacraze.io/news
🧑‍💻 Github Script: https://github.com/datacraze/youtube-...
📚 PGData Documentation: https://www.postgresql.org/docs/curre...
#PostgreSQL #DatabaseInternals #DataEngineering #SystemDesign #Backend


Nesta página do site você pode assistir ao vídeo on-line Database Internals: Page Layout Explained (based on PostgreSQL) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Data Craze 09 Dezembro 2025, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 372 vezes e gostou 17 espectadores. Boa visualização!