DB: indexes for the polling queries

- jobs(finished_at): the live view's "open or finished in the last 5 minutes"
  query, run once a second per visible tab, was a full scan of the job
  history; it is now a multi-index lookup (0.23 -> 0.04 ms at 2,000 jobs).
- benchmark_runs(state, created_at): the worker's look for the next queued run
  every 2 s scanned every run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EooZ9biu7kFNB4eDJrwQc5
This commit is contained in:
Claude committed 2026-11-01 21:04:45 +00:00
1 parent 6f4932e04d
commit 6b779debf7
5 files changed
+1549 -2

No files matched your search

File diff suppressed because it is too large. Load diff
+7
View File
@@ -169,6 +169,13 @@
"when": 1793115558680,
"tag": "0023_scan_schedule",
"breakpoints": true
},
{
"idx": 24,
"version": "6",
"when": 1793567055573,
"tag": "0024_polling_indexes",
"breakpoints": true
}
]
}