Files
huike-back/htyts_models/migrations/2026-04-30-151213_add_dbtask_indexes/up.sql
T
weli 2a2f32401a chore: misc fixes — NGX_URL, ai_score default, dbtask indexes, CLAUDE.md
- Fix NGX_URL in huiwings htyproc.env (remove /api/ngx suffix)
- Add #[serde(default)] to AiScorePayload::compare_url
- Add dbtask indexes (status_created, updated_at) for task processing perf
- Add CLAUDE.md with server mappings and deployment rules
- Ignore test-results/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 00:36:45 +08:00

11 lines
548 B
SQL

-- BTREE index on (task_status, created_at DESC) for one_pending_task query:
-- SELECT ... FROM dbtask WHERE task_status = 'PENDING' ORDER BY created_at DESC LIMIT 1
-- Also benefits all_tasks_page and zombie detection filtered by status.
CREATE INDEX IF NOT EXISTS idx_dbtask_status_created
ON dbtask (task_status, created_at DESC);
-- BTREE index on updated_at for zombie detection:
-- SELECT ... FROM dbtask WHERE updated_at < cutoff AND task_status IN (...)
CREATE INDEX IF NOT EXISTS idx_dbtask_updated_at
ON dbtask (updated_at);