writeonce/docs/stories/databasev2
shoney.arickathil cfd660a5e6 docs(db2-chains): spec + story for bounding a row's delta chain
- fixes a limitation iteration 2 shipped: compaction was supposed to
  bound chain length, but wo_wal_should_compact triggers on a whole-log
  byte ratio and cannot see one hot row's chain
- tier 1, flatten on update: the update path ALREADY folds the row for
  index maintenance and the fold already walks hop by hop, so it reports
  depth for free. Past a fixed K it writes a full row instead of a
  delta. Read <= K+1 reads, replay O(K^2) per row. No format change, no
  per-row RAM, no new trigger
- tier 2: our compaction policy has a proportional term and a
  SUPPRESSOR misleadingly called a floor; postgres's floor TRIGGERS on
  small absolute garbage. Add that term and a ceiling
- design read from .dev/reference/postgresql, not recalled:
  heap_page_prune_opt gates on an O(1) on-page hint then page fullness
  against Max(fillfactor, BLCKSZ/10); autovacuum uses base + scale *
  reltuples clamped by a max (50, 0.2, 1e8). Neither thresholds on
  new-bytes-versus-old-bytes
- K deliberately does NOT scale with table size: postgres scales a
  table-level aggregate with proportional harm, ours is per-row with
  additive cost, so scaling up would make big databases boot worst
- the story says plainly it should NOT be next: task 7 has still never
  measured whether resident: keys beats the kernel's own paging

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit f667cad2cfbe187b5973440ab1af015b2df288f8)
2026-08-30 20:38:03 +02:00
..
00-story.md docs(db2-chains): spec + story for bounding a row's delta chain 2026-08-30 20:38:03 +02:00
01-ram-ceiling-measurement.md feat(db-bench): replay baseline — boot cost tracks history, not data 2026-08-27 21:25:24 +02:00
02-table-storage-modes.md docs(db2-chains): spec + story for bounding a row's delta chain 2026-08-30 20:38:03 +02:00
03-wal-checkpoint.md docs(db2-keys): reconcile databasev2 and porch markdown with the code 2026-08-30 20:36:55 +02:00
04-io-uring-commit.md Merge master into db-residency-doctrine — and close the two half-exposed features 2026-08-29 10:14:25 +02:00
05-bounded-tables-eviction.md docs(databasev2): propagate iteration 1's findings to every consumer 2026-08-27 22:47:37 +02:00
06-cold-tiering.md docs(db2-keys): reconcile databasev2 and porch markdown with the code 2026-08-30 20:36:55 +02:00
07-single-file-db.md docs(stories): add readiness, retire status: refine, sweep all 47 iterations 2026-08-27 16:54:45 +02:00
08-query-grammar-corpus.md docs(stories): add readiness, retire status: refine, sweep all 47 iterations 2026-08-27 16:54:45 +02:00
09-cross-program-tables.md docs(stories): add readiness, retire status: refine, sweep all 47 iterations 2026-08-27 16:54:45 +02:00
10-keypair-attach-auth.md docs(stories): add readiness, retire status: refine, sweep all 47 iterations 2026-08-27 16:54:45 +02:00
11-bounded-delta-chains.md docs(db2-chains): spec + story for bounding a row's delta chain 2026-08-30 20:38:03 +02:00