Build the catalogue text in order and stop once it is full
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
The catalogue text (event_text) is the first 1 MiB of a timeline's titles and notes, rebuilt in the database after saves. oc_event_text read every duration's text in one statement and gathered every moment ID, sorted, before building it, so a rebuild grew with the timeline: about 6 s at a million moments. It now reads durations in start order through their start index and moments a page at a time by walking the moment tree (oc_events, which reads through for forks), and returns once the text is full: 0.4-0.7 s at a million moments. Durations come in start order (then ID) rather than ID order; the text written from a whole document (eventSearchText) follows the same order, with moments in time order however the document lists them, so a refresh finds the text unchanged. An old upgrade statement that re-read every moment of a timeline with empty text on each migration now reads at most 20,000. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/7bbcb4844fe54bc03edea57db36ceff7e9689256
Open Build the catalogue text in order and stop once it is full in the timeline