Compare commits
1 Commits
feat/backe
...
chore/craw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fab63f9f8c |
15
backend/migrations/0016_crawler_jobs_drop_failed_state.sql
Normal file
15
backend/migrations/0016_crawler_jobs_drop_failed_state.sql
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
-- The original 0012 partial index covers `state IN ('pending','failed')`,
|
||||||
|
-- but `ack_failed` in src/crawler/jobs.rs only writes `dead` or
|
||||||
|
-- `pending` — `failed` is never set. The index branch on `failed`
|
||||||
|
-- never matches any row, so it's dead weight on every write.
|
||||||
|
--
|
||||||
|
-- Drop and recreate the index without the dead branch. The CHECK
|
||||||
|
-- constraint on `state` still allows `'failed'` so a future migration
|
||||||
|
-- can adopt that terminal-but-retryable state without a second
|
||||||
|
-- schema change.
|
||||||
|
|
||||||
|
DROP INDEX IF EXISTS crawler_jobs_ready_idx;
|
||||||
|
|
||||||
|
CREATE INDEX crawler_jobs_ready_idx
|
||||||
|
ON crawler_jobs (scheduled_at)
|
||||||
|
WHERE state = 'pending';
|
||||||
Reference in New Issue
Block a user