series

Series

Some topics don’t fit in one post. These are written to be read in order, and every part links to the next.

01 / 03

Postgres from the inside

A slow walk through the storage layer, with pageinspect open the whole time: heap pages, B-tree indexes and vacuum.

3 parts · 27 min in total

  1. 01

    What actually happens on INSERT

    From the parser to the write-ahead log: following one row into a Postgres table.

    · 12 min

  2. 02

    Reading a B-tree page by hand

    Open an index with pageinspect, walk from the root to a single row and see what an index actually promises.

    · 5 min

  3. 03

    Vacuum, seen from the page

    Dead tuples, the free space map and why VACUUM almost never gives disk space back.

    · 10 min

02 / 03

A build system in 200 lines

Writing a small, correct build tool in Rust, one idea per post: why, content hashing and the dependency graph.

3 parts · 23 min in total

  1. 01

    A build system in 200 lines: why bother

    Writing a tiny build tool is the fastest way to understand the big ones.

    · 5 min

  2. 02

    A build system in 200 lines: hashing inputs

    Timestamps lie and content hashes don’t. Deciding when a step is really out of date.

    · 8 min

  3. 03

    A build system in 200 lines: the graph

    Topological order, cycles that explain themselves and running independent steps in parallel.

    · 10 min

03 / 03

CSS for backend people

The parts of CSS I wish someone had explained to me in terms I already knew: precedence rules and layout algorithms.

2 parts · 16 min in total

  1. 01

    CSS for backend people: the cascade

    Specificity, order and inheritance, explained as a merge conflict.

    · 7 min

  2. 02

    CSS for backend people: layout without tears

    Flexbox for one dimension, grid for two, and the three properties behind most layouts.

    · 9 min

Coming up next

A short series on reading query plans, starting with EXPLAIN (ANALYZE, BUFFERS) and ending with the plan that made me rewrite a report. Subscribe to get the first part when it’s out.