From af7b1591c1eb6a7c4ab87bb94d1add448ba8db03 Mon Sep 17 00:00:00 2001 From: OG T Date: Fri, 10 Apr 2026 10:33:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(rag):=20phase35=20ivfflat=20=E5=90=91?= =?UTF-8?q?=E9=87=8F=E7=B4=A2=E5=BC=95=20=E2=80=94=205814=20chunks=20?= =?UTF-8?q?=E5=B7=B2=E5=BB=BA=E7=AB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已在 prod 執行: idx_rag_chunks_embedding (lists=100, cosine) Co-Authored-By: Claude Sonnet 4.6 --- apps/api/migrations/phase35_rag_ivfflat_index.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 apps/api/migrations/phase35_rag_ivfflat_index.sql diff --git a/apps/api/migrations/phase35_rag_ivfflat_index.sql b/apps/api/migrations/phase35_rag_ivfflat_index.sql new file mode 100644 index 00000000..bad68db5 --- /dev/null +++ b/apps/api/migrations/phase35_rag_ivfflat_index.sql @@ -0,0 +1,14 @@ +-- 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';