-- 297_study_questions_needs_review_idx.sql
-- needs_review 큐 뷰(GET /study-questions?needs_review=true) + count 용 부분 인덱스.
-- WHERE 술어(deleted_at IS NULL AND needs_review)는 큐 뷰 쿼리 WHERE 와 글자 단위로
--   일치해야 partial index 가 선택된다 (HR-5 쿼리와 정합 필수).
-- soft-delete 행 제외(deleted_at IS NULL 합류).

CREATE INDEX IF NOT EXISTS idx_study_questions_needs_review
    ON study_questions (study_topic_id)
    WHERE deleted_at IS NULL AND needs_review;
