Save PostgreSQL timelines incrementally with persistent AVL indexes
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
Sparse saves no longer rebuild the whole timeline. Moments move into their own rows; the moment, duration and arc trees become AVL trees with stable node IDs whose insertions and deletions rewrite only the nodes on a path. Metadata edits touch one moment row and its search row. Relationships and search rows change only for the entities a patch names, revisions store the patch (with a full snapshot every 1,000 saves or once patches outweigh the document), and the catalogue text is rebuilt in the database after the save commits. The timeline row is updated once per save with its indexed columns left alone, so the update stays in place instead of rewriting the catalogue's GIN index. Viewport queries look up interval nodes by timeline and key instead of scanning every timeline's rows. Whole-timeline reads use an ordered scan instead of walking the tree. npm run migrate converts existing indexes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Ti36soiZpKdSxKfvQLEcfY https://github.com/openchronology/timeline-app/commit/61c0f7704b488c3eb0359f40c114c0982d53f458
Open Save PostgreSQL timelines incrementally with persistent AVL indexes in the timeline