Commit b2f1c80
perf: Add composite index on jobs table for efficient job fetching
Add INDEX (status, priority, scheduled_time) to optimize the critical
populate query:
SELECT ... FROM jobs
WHERE status='pending' AND scheduled_time <= NOW()
ORDER BY priority ASC, scheduled_time ASC
This index covers the WHERE clause and ORDER BY, eliminating table scans
and filesorts for large job queues.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent c738cae commit b2f1c80
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
0 commit comments