mirror of
https://github.com/screentinker/screentinker.git
synced 2026-06-29 09:23:16 -06:00
The dashboard uptime query (WHERE device_id=? AND timestamp>?) and the per-device retention prune (WHERE device_id=? AND timestamp<?) were both full table scans. At 1M+ rows (the outage report) this was the dashboard-degradation cause that persisted even after the reconnect storm stopped. - schema.sql: add idx_device_status_log_device_ts(device_id, timestamp); both queries now SEARCH ... USING INDEX instead of SCAN (verified via EXPLAIN). - database.js: same index as a migration for existing DBs (idempotent). - schema.sql defined device_status_log twice; drop the duplicate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| database.js | ||
| schema.sql | ||