Every backend engineer has run SELECT * FROM users WHERE id = 42 a thousand times.
Most assume the database goes and grabs exactly that one row.
But it doesn’t. It can’t.
Disks read in fixed-size blocks, not single rows — so databases define their own unit for this: a page. Every read pulls the whole page, then selects the row from it.
That one fact explains a lot — why deleted rows don’t vanish immediately, why a table’s file is bigger than its raw data, why “no index” means scanning every single page, and why an index actually works (it’s just a sorted shortcut to a page + slot).
I wrote a deep dive on pages, slotted pages, heap files, and full table scans — the physical layer underneath every SQL query: https://jishnusaha.me/blog/database/how-db-store-data
데이터베이스는 실제로 데이터를 어떻게 저장합니까?
작성자
카테고리:
← 피드로
추출 본문 · 출처: dev.to · https://dev.to/jishnusaha89/how-does-a-database-actually-store-your-data-17f1