Files
geo/server/migrations/20260505213000_generation_task_state_check_indexes.up.sql
T

10 lines
386 B
SQL
Raw Normal View History

2026-05-05 23:43:10 +08:00
CREATE INDEX IF NOT EXISTS idx_generation_tasks_active_state_check
ON generation_tasks(updated_at DESC, id DESC)
WHERE article_id IS NOT NULL
AND status IN ('queued', 'running');
CREATE INDEX IF NOT EXISTS idx_generation_tasks_recent_completed_state_check
ON generation_tasks(updated_at DESC, id DESC)
WHERE article_id IS NOT NULL
AND status = 'completed';