Files
hyungi_document_server/migrations/229_progress_pending_review_idx.sql
Hyungi Ahn 242288aaf3 fix(study): Phase 1 migrations 222-225 → 226-229 — markdown canonical layer 222 충돌 회피
타 PR (markdown canonical layer Phase 1B) 의 222_processing_queue_stage_markdown.sql 와
번호 충돌. init_db 가 'migration 버전 중복' 에러 띄움. 4파일 + SQL 헤더 주석 일괄 rename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 09:32:16 +09:00

9 lines
492 B
SQL

-- 229_progress_pending_review_idx.sql
-- pending_review 탭 — 미확인 오답 조회 빠르게.
-- partial 조건은 last_outcome 만, reviewed/attempted 비교는 쿼리에서 (이전 확인완료한
-- 문제가 다시 wrong/unsure 됐을 때 잡히도록 last_reviewed_at < last_attempted_at 필터).
CREATE INDEX IF NOT EXISTS idx_progress_pending_review
ON study_question_progress (user_id, study_topic_id, last_attempted_at DESC)
WHERE last_outcome IN ('wrong', 'unsure');