DB performance: WAL mode, indexes, query optimization, and by-ID image serving #128
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/128/head"
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?
Summary
Four changes to improve database performance, especially at ~30k snapshots:
PRAGMA journal_mode=WAL+synchronous=NORMALso periodic scan writes no longer block web UI reads(camera, recorded_at)for scrubber/day queries,(motion, recorded_at)for motion range queriesDATE(recorded_at) = ?→ range scans (recorded_at >= ? AND recorded_at < ?) so the new indexes are actually usedGET /snapshots/{id}/imgwith PK lookup, instead of re-runninglist_snapshots_for_dayon every scrubber frameCloses #127