Expire in small saves, finding what to delete through the trees
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
Retention deleted up to 200,000 moments in one save, holding the timeline's lock for minutes: saves arriving meanwhile (a log) waited for it, and their lock wait counts against the 30 s statement limit. It now deletes in saves of at most 5,000 moments, each a transaction of its own, for up to ten minutes a run, retried when another save got in first; the statistics refreshes those saves ask for run once, after the last, rather than after each (about 10 s each on a fork at a million moments). deleteWhere finds moments by walking the moment tree a page at a time between the range's bounds (oc_events, which reads through for forks), stopping at its limit, instead of a filtered scan of the timeline; durations wholly inside a range through their start index, bounded too. At a million moments, deleting 50,000 took 96 s in saves of about 7 s on a fork (200 s before, with a refresh per save), and saves of 9-14 s on a timeline a fork reads. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/478f8e83f089f35871695876b680c2fd9d62d8d1
Open Expire in small saves, finding what to delete through the trees in the timeline