Measure capture-table storage after a convective season and revisit the retention windows #158
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#158
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of #133, which delivered the unified 13-month horizon but explicitly could not complete its "size the result at 13 months" task. Parent: #22.
Why this couldn't be done in #133
Production was measured on 2026-07-28 (full data on #133), a few hours after capture was ungated. The capture tables held essentially nothing:
nws_alert_snapshotsalert_radar_frameslightning_clustersProjecting 13 months from that would be arithmetic wearing a measurement's clothes — the same thing #130 and #132 were flagged for. Better to wait for real data.
What to do
nws_alert_snapshots,alert_radar_framesandlightning_clustersafter a full convective season (revisit ~autumn 2026).RETENTION_LIGHTNING_CLUSTERS_DAYS. It is pinned at 90 days on a reasoned but unmeasured argument — lightning being the highest-volume, fastest-decaying history. If measurement contradicts that, fold it into the horizon or pin it somewhere else deliberately.frames per eventagainst thealert_radar_frame_max_per_event = 24cap. The current 15.5 average rests on n=2; the event rate (1.82/day/location) is solid, that figure is not.Watch items carried over
sent_alertsbloat. Measured 1,023 kB of live data sitting in a 21 MB heap — roughly 20× bloat from UPDATE churn (cleared_at,escalation_count,digest_pending,acknowledged_at), with autovacuum last run 6 days prior. #133 raised this table's window from 90 to 400 days, so it now stops pruning entirely for ~10 months while accruing ~9.1 rows/day. Worth confirming autovacuum keeps pace, and a one-offVACUUM FULLwould reclaim ~20 MB today.sent_alerts.radar_snapshot_pathis NULL on all 1,708 rows whilealert_radar_frameshas 31. Most likely benign — both frame-bearing alerts were already active when capture ungated, so the first-fire moment had passed. But if it is still NULL after a fresh alert fires post-deploy, that is a #85 regression and deserves its own issue.product_freshness_samplesindex cost. 63 MB total, and its indexes cost as much as its data (31 MB vs 32 MB) — five indexes on a 164-byte row, 78% of itspc_fetch. It is observability rather than history and correctly stays outside the horizon at 14 days, but it is the single largest table in the database and the index ratio looks worth a look on its own merits.