postgres=# select * from sessions where video_id = 'c0wKWcPZnH0';

Vibe Hacking Postgres

· 73:44 · Storage internals

Prototype merging sparse B-tree leaf pages and audit its correctness failures.

session summary

The workshop focused on a prototype for reclaiming B-tree bloat by merging adjacent sparse leaf pages. Kirk proposed an incremental, access-exclusive-lock design that first merges only one pair, prioritizing correctness of forward and backward scans. The pgindex_reclaim extension identified merge candidates, but execution crashed. Inspection showed incomplete parent-page handling and incorrect WAL/critical-section logic. The group chose to stop trusting the generated merge code, add a reproducible regression test, study related upstream page-deletion work, and restart from the smallest verifiable merge.

timecodes

  1. Why merge sparse B-tree pages
  2. Forward and backward scan constraints
  3. Smallest verifiable merge design
  4. How the approach differs from pg_squeeze
  5. Building and running pgindex_reclaim
  6. Candidate pages found, execution crashes
  7. Critical sections, WAL, and parent updates
  8. Regression test and restart plan