Commit 106d20a
authored
Truncate stale
Migration 003 cleared `logging` for entries older than 2024-01-01. The
DB has since grown to 17GB on the production instance, dominated by
build-log text. Anything older than ~6 months is unlikely to be
inspected and the retained log costs disk space + read cost on any
query that reads full row payloads (the latter mostly fixed by 005's
covering index, but disk space and table scans elsewhere still
benefit).
The cutoff (20251106000000) is fixed and approximately 6 months before
the current development date.
This UPDATE doesn't shrink the DB file. Freed page space is reused by
future inserts; to actually reclaim disk space, run VACUUM in a
maintenance window after this migration is deployed (it cannot run
inside the migration's transaction).
Verified locally: rows with build_dt before the cutoff have their
logging text replaced; newer rows untouched.logging entries (older than 2025-11-06) (#76)1 parent 783ff4c commit 106d20a
1 file changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments