Files
awoooi/apps/api/migrations/phase35_rag_ivfflat_index.sql
OG T af7b1591c1
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
feat(rag): phase35 ivfflat 向量索引 — 5814 chunks 已建立
已在 prod 執行: idx_rag_chunks_embedding (lists=100, cosine)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 10:33:32 +08:00

15 lines
418 B
SQL

-- Phase 35: RAG ivfflat 向量索引
-- 前提: rag_chunks 已有 2582+ chunks
-- 執行: psql awoooi_prod
-- 2026-04-10 Claude Sonnet 4.6 Asia/Taipei
CREATE INDEX IF NOT EXISTS idx_rag_chunks_embedding
ON rag_chunks
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);
-- 驗證
SELECT indexname, indexdef
FROM pg_indexes
WHERE tablename = 'rag_chunks' AND indexname = 'idx_rag_chunks_embedding';