- 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
2 lines
167 B
SQL
2 lines
167 B
SQL
CREATE INDEX `benchmark_runs_state_idx` ON `benchmark_runs` (`state`,`created_at`);--> statement-breakpoint
|
|
CREATE INDEX `jobs_finished_idx` ON `jobs` (`finished_at`); |