-- Hot-path indexes (park-2, 2026-10-24). Every per-session read of the ledger was a full -- scan (no index on identity), and the camera/relay telemetry queries scanned -- device_events (no index beyond the PK). Both tables grow with the operator's traffic, -- so request time grew with it: the booth's active-sessions call reached ~2 s and froze -- the event loop, which surfaced as relay "timeouts". The handler was also rewritten to -- avoid per-row reads; these indexes make the remaining identity/telemetry lookups O(log n) -- whatever the data volume. All additive; the previous image ignores them on rollback. CREATE INDEX IF NOT EXISTS `ledger_events_identity_idx` ON `ledger_events` (`identity`,`index`); --> statement-breakpoint CREATE INDEX IF NOT EXISTS `device_events_cat_kind_time_idx` ON `device_events` (`category`,`kind`,`occurred_at`); --> statement-breakpoint CREATE INDEX IF NOT EXISTS `device_events_kind_time_idx` ON `device_events` (`kind`,`occurred_at`); --> statement-breakpoint CREATE INDEX IF NOT EXISTS `snapshots_identity_idx` ON `snapshots` (`identity`); --> statement-breakpoint CREATE INDEX IF NOT EXISTS `sessions_state_idx` ON `sessions` (`state`); --> statement-breakpoint CREATE INDEX IF NOT EXISTS `sessions_subscription_idx` ON `sessions` (`subscription_id`,`state`);