-- UNIQUE (doc_id, source_type, chunker_version, chunk_index).
-- dup-check (doc_id, chunk_index)=0 확인 (2026-05-24) → legacy backfill 후 키 유효.
-- 비-CONCURRENTLY: runner 트랜잭션 안전 + ~30K rows 규모 현실적.
CREATE UNIQUE INDEX IF NOT EXISTS uq_document_chunks_source_version_index
ON document_chunks (doc_id, source_type, chunker_version, chunk_index);
