{"id":197,"date":"2026-03-09T15:52:00","date_gmt":"2026-03-09T15:52:00","guid":{"rendered":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/09\/building-rag-with-pgvector-why-i-stopped-paying-fo\/"},"modified":"2026-03-09T22:00:15","modified_gmt":"2026-03-09T22:00:15","slug":"building-rag-with-pgvector-why-i-stopped-paying-fo","status":"publish","type":"post","link":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/09\/building-rag-with-pgvector-why-i-stopped-paying-fo\/","title":{"rendered":"pgvector\u3067RAG\u3092\u69cb\u7bc9\u3059\u308b: Pinecone\u306e\u8ab2\u91d1\u3092\u3084\u3081\u305f\u7406\u7531"},"content":{"rendered":"<p>Pinecone\u306e\u8acb\u6c42\u66f8\u3092\u958b\u3044\u305f\u306e\u306f\u53bb\u5e74\u306e9\u6708\u3067\u3001\u91d1\u984d\u306f$283\u3060\u3063\u305f\u3002<\/p>\n<p>3\u4eba\u30c1\u30fc\u30e0\u3067\u793e\u5185\u5411\u3051\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u691c\u7d22\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u3044\u3066\u3001RAG\u306e\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u3068\u3057\u3066Pinecone\u306eStarter \u2192 Standard\u3068\u4e57\u308a\u7d99\u3044\u3067\u304d\u305f\u3002\u30d9\u30af\u30c8\u30eb\u6570\u306f\u5f53\u6642\u7d0440\u4e07\u4ef6\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u306f1\u65e5\u305b\u3044\u305c\u3044500\u56de\u3002\u305d\u308c\u3067$280\u3002\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3068\u3057\u3066\u306f\u6b63\u76f4\u3057\u3093\u3069\u3044\u6570\u5b57\u3060\u3057\u3001\u4f55\u3088\u308a\u300c\u3082\u3046\u3061\u3087\u3063\u3068\u30b9\u30b1\u30fc\u30eb\u3057\u305f\u3089\u500d\u306b\u306a\u308b\u300d\u3068\u3044\u3046\u898b\u3048\u306a\u3044\u5727\u529b\u304c\u305a\u3063\u3068\u3042\u3063\u305f\u3002<\/p>\n<p>\u305d\u3053\u3067\u540c\u50da\u306eTaku\u304c\u300c\u3069\u3046\u305bPostgreSQL\u3082\u3046\u4f7f\u3063\u3066\u308b\u3093\u3060\u3057\u3001pgvector\u3067\u3088\u304f\u306a\u3044?\u300d\u3068\u8a00\u3044\u51fa\u3057\u305f\u3002\u6700\u521d\u306f\u300c\u307e\u3042\u305d\u3046\u3060\u3051\u3069&#8230;\u300d\u3068\u3044\u3046\u611f\u3058\u3067\u6d41\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u3042\u308b\u9031\u672b\u306b\u81ea\u5206\u3067\u8a66\u3057\u3066\u307f\u305f\u3089\u3001\u601d\u3063\u305f\u4ee5\u4e0a\u306b\u8a71\u304c\u65e9\u304b\u3063\u305f\u3002<\/p>\n<h2>\u6708$280\u306ePinecone\u3068\u3001\u4f55\u306b\u8ab2\u91d1\u3057\u3066\u3044\u305f\u306e\u304b\u3068\u3044\u3046\u7591\u554f<\/h2>\n<p>Pinecone\u306f\u78ba\u304b\u306b\u3088\u304f\u3067\u304d\u3066\u3044\u308b\u3002API\u306f\u304d\u308c\u3044\u3060\u3057\u3001\u30de\u30cd\u30fc\u30b8\u30c9\u3067\u904b\u7528\u30b3\u30b9\u30c8\u306f\u30bc\u30ed\u3001\u30e1\u30bf\u30c7\u30fc\u30bf\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3082\u76f4\u611f\u7684\u306b\u66f8\u3051\u308b\u3002\u6700\u521d\u306e\u6570\u30f6\u6708\u306f\u300c\u3053\u308c\u3067\u6b63\u89e3\u3060\u300d\u3068\u601d\u3063\u3066\u3044\u305f\u3002<\/p>\n<p>\u554f\u984c\u306f\u30b3\u30b9\u30c8\u30e2\u30c7\u30eb\u306b\u3042\u308b\u3002Pinecone\u306f\u30d9\u30af\u30c8\u30eb\u306e\u300c\u4fdd\u5b58\u6570\u300d\u3068\u300c\u8aad\u307f\u66f8\u304d\u306e\u30e6\u30cb\u30c3\u30c8\u6570\u300d\u3067\u8ab2\u91d1\u3055\u308c\u308b\u3002\u3046\u3061\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306f\u8aad\u307f\u66f8\u304d\u3088\u308a\u3082\u4fdd\u5b58\u304c\u4e3b\u4f53\u3067\u300140\u4e07\u30d9\u30af\u30c8\u30eb\u3068\u3044\u3046\u306e\u306f\u305f\u3044\u3057\u3066\u5927\u304d\u304f\u306a\u3044\u6570\u5b57\u306a\u306e\u306b\u3001Standard tier\u3058\u3083\u306a\u3044\u3068\u8907\u6570\u306enamespace\u304c\u4f7f\u3048\u306a\u3044\u3002namespace\u3092\u4f7f\u3044\u305f\u304b\u3063\u305f\u7406\u7531\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u30c6\u30ca\u30f3\u30c8\u3054\u3068\u306b\u30c7\u30fc\u30bf\u3092\u5206\u96e2\u3057\u305f\u304b\u3063\u305f\u304b\u3089\u3002\u305d\u308c\u3060\u3051\u306e\u305f\u3081\u306b$200\/\u6708\u306etier\u306b\u4e0a\u304c\u308b\u306e\u306f\u3001\u3069\u3046\u8003\u3048\u3066\u3082\u30aa\u30fc\u30d0\u30fc\u30ad\u30eb\u3060\u3063\u305f\uff08\u6a5f\u80fd\u306e\u534a\u5206\u3082\u4f7f\u308f\u306a\u3044 tier \u306b\u4e0a\u3052\u308b\u306e\u306f\u3001EV\u5145\u96fb\u306e\u305f\u3081\u306b\u9ad8\u901f\u9053\u8def\u5e74\u9593\u30d1\u30b9\u3092\u8cb7\u3046\u611f\u899a\u306b\u8fd1\u3044\uff09\u3002<\/p>\n<p>\u52a0\u3048\u3066\u3001Pinecone\u306f\u30c7\u30fc\u30bf\u304c\u81ea\u5206\u306e\u30a4\u30f3\u30d5\u30e9\u306e\u5916\u306b\u3042\u308b\u3002\u3053\u308c\u306f\u793e\u5185\u30c4\u30fc\u30eb\u3060\u3063\u305f\u306e\u3067\u3001\u4f1a\u793e\u306e\u65b9\u91dd\u7684\u306b\u3082\u30b0\u30ec\u30fc\u306a\u90e8\u5206\u304c\u3042\u3063\u305f\u3002\u6cd5\u52d9\u304b\u3089\u300c\u305d\u306e\u30c7\u30fc\u30bf\u3001\u3069\u3053\u306b\u3042\u308b\u306e?\u300d\u3068\u805e\u304b\u308c\u305f\u3068\u304d\u3001\u300cPinecone\u3068\u3044\u3046\u30a2\u30e1\u30ea\u30ab\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u30b5\u30fc\u30d0\u30fc\u306b&#8230;\u300d\u3068\u3044\u3046\u56de\u7b54\u306f\u3001\u3042\u307e\u308a\u53d7\u3051\u5165\u308c\u3089\u308c\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>So\u3001pgvector\u306b\u4e57\u308a\u63db\u3048\u308b\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u306f\u7d14\u7c8b\u306b\u30b3\u30b9\u30c8\u3068\u30c7\u30fc\u30bf\u4e3b\u6a29\u306e2\u70b9\u3060\u3063\u305f\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u540c\u7b49\u306a\u3089\u3001\u306e\u8a71\u3060\u304c\u3002<\/p>\n<h2>PostgreSQL 16 + pgvector 0.7.3\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7: \u5b9f\u969b\u306b\u3084\u3063\u305f\u624b\u9806<\/h2>\n<p>\u307e\u305apgvector\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3064\u3044\u3066\u30022025\u5e74\u672b\u6642\u70b9\u3067v0.7.3\u304c\u51fa\u3066\u3044\u3066\u3001HNSW indexing\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c0.6\u7cfb\u304b\u3089\u5927\u304d\u304f\u6539\u5584\u3055\u308c\u3066\u3044\u308b\u30020.5\u7cfb\u3092\u4f7f\u3063\u3066\u3044\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u307e\u3060\u591a\u304f\u6b8b\u3063\u3066\u3044\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3001\u7279\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f5c\u6210\u69cb\u6587\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u3046\u3061\u306fAWS RDS PostgreSQL 16\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3001pgvector\u306e\u6709\u52b9\u5316\u306f\u5358\u7d14\u3060\u3063\u305f\u3002\u6b63\u76f4\u3001\u62cd\u5b50\u629c\u3051\u3059\u308b\u304f\u3089\u3044\u306b\u306f\u3002<\/p>\n<pre><code class=\"language-sql\">-- extension\u306e\u6709\u52b9\u5316\nCREATE EXTENSION IF NOT EXISTS vector;\n\n-- \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30c1\u30e3\u30f3\u30af\u306e\u30c6\u30fc\u30d6\u30eb\nCREATE TABLE document_chunks (\n    id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n    doc_id      UUID NOT NULL,\n    tenant_id   UUID NOT NULL,           -- \u30c6\u30ca\u30f3\u30c8\u5206\u96e2\u7528\n    content     TEXT NOT NULL,\n    embedding   vector(1536),            -- text-embedding-3-small\u306e\u6b21\u5143\u6570\n    metadata    JSONB,\n    created_at  TIMESTAMPTZ DEFAULT now()\n);\n\n-- HNSW\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 (IVFFlat\u3088\u308a\u7cbe\u5ea6\u304c\u9ad8\u304f\u3001\u66f4\u65b0\u306b\u3082\u5f37\u3044)\nCREATE INDEX ON document_chunks\n    USING hnsw (embedding vector_cosine_ops)\n    WITH (m = 16, ef_construction = 64);\n\n-- \u30c6\u30ca\u30f3\u30c8\u3054\u3068\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3092\u60f3\u5b9a\u3057\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\nCREATE INDEX ON document_chunks (tenant_id);\n<\/code><\/pre>\n<p>\u57cb\u3081\u8fbc\u307f\u306e\u751f\u6210\u3068\u30b9\u30c8\u30a2\u306fPython\u3067\u66f8\u3044\u305f\u3002OpenAI\u306etext-embedding-3-small\u3092\u4f7f\u3063\u3066\u3044\u3066\u30011536\u6b21\u5143\u3002<\/p>\n<pre><code class=\"language-python\">import psycopg2\nfrom openai import OpenAI\nfrom pgvector.psycopg2 import register_vector\n\nclient = OpenAI()\n\ndef store_chunks(conn, chunks: list[dict], tenant_id: str):\n    register_vector(conn)\n\n    # \u30d0\u30c3\u30c1\u3067\u57cb\u3081\u8fbc\u307f\u3092\u53d6\u5f97 (API\u30b3\u30b9\u30c8\u3092\u6e1b\u3089\u3059\u305f\u3081)\n    texts = [c[&quot;content&quot;] for c in chunks]\n    response = client.embeddings.create(\n        input=texts,\n        model=&quot;text-embedding-3-small&quot;\n    )\n\n    with conn.cursor() as cur:\n        for chunk, emb_data in zip(chunks, response.data):\n            cur.execute(\n                &quot;&quot;&quot;\n                INSERT INTO document_chunks \n                    (doc_id, tenant_id, content, embedding, metadata)\n                VALUES (%s, %s, %s, %s, %s)\n                &quot;&quot;&quot;,\n                (\n                    chunk[&quot;doc_id&quot;],\n                    tenant_id,\n                    chunk[&quot;content&quot;],\n                    emb_data.embedding,   # pgvector.psycopg2\u304c\u30ea\u30b9\u30c8\u3092vector\u578b\u306b\u5909\u63db\n                    chunk.get(&quot;metadata&quot;, {}),\n                )\n            )\n    conn.commit()\n\ndef search_similar(conn, query: str, tenant_id: str, limit: int = 5):\n    register_vector(conn)\n\n    q_emb = client.embeddings.create(\n        input=query,\n        model=&quot;text-embedding-3-small&quot;\n    ).data[0].embedding\n\n    with conn.cursor() as cur:\n        cur.execute(\n            &quot;&quot;&quot;\n            SELECT content, metadata, \n                   1 - (embedding &lt;=&gt; %s::vector) AS similarity\n            FROM document_chunks\n            WHERE tenant_id = %s\n            ORDER BY embedding &lt;=&gt; %s::vector\n            LIMIT %s\n            &quot;&quot;&quot;,\n            (q_emb, tenant_id, q_emb, limit)\n        )\n        return cur.fetchall()\n<\/code><\/pre>\n<p><code>&lt;=&gt;<\/code> \u304c\u30b3\u30b5\u30a4\u30f3\u8ddd\u96e2\u306e\u6f14\u7b97\u5b50\u3002<code>&lt;-&gt;<\/code> \u304cL2\u8ddd\u96e2\u3002\u6700\u521d\u3053\u308c\u3092\u6df7\u540c\u3057\u3066\u3001\u306a\u3093\u304b\u3061\u3087\u3063\u3068\u5909\u306a\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304f\u308b\u306a\u3068\u601d\u3063\u305f\u3089\u8ddd\u96e2\u95a2\u6570\u304c\u9055\u3063\u3066\u3044\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u304c\u3042\u3063\u305f\u3002\u57cb\u3081\u8fbc\u307f\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u3069\u3063\u3061\u304c\u5411\u304f\u304b\u306f\u5909\u308f\u308b\u306e\u3067\u3001OpenAI\u306e\u30e2\u30c7\u30eb\u306a\u3089\u30b3\u30b5\u30a4\u30f3\u8ddd\u96e2\u3092\u4f7f\u3046\u306e\u304c\u57fa\u672c\u3002<\/p>\n<h2>2\u9031\u9593\u306e\u4e26\u884c\u7a3c\u50cd\u3067\u898b\u3048\u305f\u3053\u3068<\/h2>\n<p>\u79fb\u884c\u306b\u969b\u3057\u30662\u9031\u9593\u3001Pinecone\u3068pgvector\u3092A\/B\u3067\u52d5\u304b\u3057\u305f\u3002\u540c\u3058\u30af\u30a8\u30ea\u3092\u4e21\u65b9\u306b\u6295\u3052\u3066\u3001\u8fd4\u3063\u3066\u304f\u308b\u30c1\u30e3\u30f3\u30af\u306e\u5185\u5bb9\u3092\u6bd4\u8f03\u3059\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u691c\u8a3c\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u3001top-5\u306e\u4e00\u81f4\u7387\u306f\u7d0487%\u3060\u3063\u305f\u3002\u5b8c\u5168\u4e00\u81f4\u3067\u306f\u306a\u3044\u304c\u3001\u56de\u7b54\u54c1\u8cea\u306b\u5f71\u97ff\u304c\u51fa\u308b\u3088\u3046\u306a\u5dee\u3067\u306f\u306a\u304b\u3063\u305f\u3002\u3053\u308c\u306f\u6b63\u76f4\u3001\u601d\u3063\u305f\u3088\u308a\u8fd1\u3044\u6570\u5b57\u3060\u3063\u305f\u2014\u2014\u79fb\u884c\u524d\u306f\u300c\u5c02\u7528\u30d9\u30af\u30c8\u30ebDB\u3068\u6226\u3048\u308b\u308f\u3051\u306a\u3044\u300d\u3068\u3044\u3046\u5148\u5165\u89b3\u304c\u3042\u3063\u305f\u306e\u3067\u3002<\/p>\n<p>\u30ec\u30a4\u30c6\u30f3\u30b7\u306f\u6761\u4ef6\u306b\u3088\u308b\u300240\u4e07\u30d9\u30af\u30c8\u30eb\u3001\u30c6\u30ca\u30f3\u30c8\u3042\u305f\u308a\u5e73\u57471\u4e07\u4ef6\u3068\u3044\u3046\u69cb\u6210\u3067:<\/p>\n<ul>\n<li>Pinecone (p1.x1): p50\u3067\u7d0445ms\u3001p99\u3067\u7d04120ms<\/li>\n<li>pgvector HNSW (RDS db.r6g.large): p50\u3067\u7d0438ms\u3001p99\u3067\u7d0495ms<\/li>\n<\/ul>\n<p>pgvector\u306e\u65b9\u304c\u901f\u3044\u3001\u3068\u3044\u3046\u306e\u306f\u6b63\u78ba\u3067\u306f\u306a\u304f\u3066\u3001\u300c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30db\u30c3\u30d7\u304c1\u3064\u6e1b\u308b\u304b\u3089\u540c\u3058AWS VPC\u5185\u3067\u3042\u308c\u3070RTT\u304c\u5c0f\u3055\u304f\u306a\u308b\u300d\u3068\u3044\u3046\u3060\u3051\u306e\u8a71\u3060\u3068\u601d\u3046\u3002Pinecone\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u304cus-east-1\u306b\u56fa\u5b9a\u3055\u308c\u3066\u3044\u3066\u3001\u3046\u3061\u306e\u30a2\u30d7\u30ea\u30b5\u30fc\u30d0\u30fc\u3082us-east-1\u306b\u3042\u308b\u306e\u306b\u3001\u306a\u305c\u304bp99\u3067\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u9ad8\u304b\u3063\u305f\u3002<\/p>\n<p>One thing I noticed: \u30c6\u30ca\u30f3\u30c8\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306e\u66f8\u304d\u65b9\u3067\u6027\u80fd\u304c\u5927\u304d\u304f\u5909\u308f\u308b\u3002<code>WHERE tenant_id = %s ORDER BY embedding &lt;=&gt; ... LIMIT 5<\/code> \u3068\u3059\u308c\u3070\u3001PostgreSQL\u306f\u307e\u305atenant_id\u3067\u30d5\u30a3\u30eb\u30bf\u3057\u3066\u304b\u3089\u30d9\u30af\u30c8\u30eb\u691c\u7d22\u3092\u304b\u3051\u308b\u3002\u304c\u3001\u30c6\u30ca\u30f3\u30c8\u3042\u305f\u308a\u306e\u30c7\u30fc\u30bf\u304c\u5c11\u306a\u3044\uff08100\u4ef6\u4ee5\u4e0b\uff09\u3068HNSW\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u52b9\u304b\u305a\u306b\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u30b9\u30ad\u30e3\u30f3\u304c\u8d70\u308b\u3053\u3068\u304c\u3042\u308b\u3002<code>SET enable_seqscan = off;<\/code> \u3067\u5f37\u5236\u7684\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u308f\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u304c\u3001\u672c\u756a\u3067\u305d\u308c\u3092\u3084\u308b\u306e\u306f\u614e\u91cd\u306b\u3057\u305f\u65b9\u304c\u3044\u3044\u3002<\/p>\n<h2>\u672c\u756a\u3067\u8e0f\u3093\u3060\u5730\u96f7: IVFFlat\u3092\u6700\u521d\u306b\u9078\u3093\u3060\u8a71<\/h2>\n<p>\u3053\u3053\u304c\u4e00\u756a\u66f8\u304d\u305f\u3044\u90e8\u5206\u3002<\/p>\n<p>\u6700\u521d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306fHNSW\u3067\u306f\u306a\u304fIVFFlat\u3092\u9078\u3093\u3060\u3002\u7406\u7531\u306f\u5358\u7d14\u3067\u300cpgvector\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u3088\u304f\u898b\u304b\u3051\u308b\u306e\u304cIVFFlat\u300d\u3060\u3063\u305f\u304b\u3089\u2014\u2014\u4eca\u601d\u3048\u3070\u3001\u53e4\u3044\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9d5c\u5451\u307f\u306b\u3057\u305f\u5b8c\u5168\u306a\u5224\u65ad\u30df\u30b9\u3060\u3002<\/p>\n<p>IVFFlat\u306f\u4e8b\u524d\u306b<code>LISTS<\/code>\u30d1\u30e9\u30e1\u30fc\u30bf\uff08\u30af\u30e9\u30b9\u30bf\u6570\uff09\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u3066\u3001\u3053\u306e\u3068\u304d\u30d9\u30af\u30c8\u30eb\u6570\u304c\u5341\u5206\u306b\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u3044\u7269\u306b\u306a\u3089\u306a\u3044\u3002pgvector\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u300c\u30d9\u30af\u30c8\u30eb\u6570\u306e\u5e73\u65b9\u6839\u7a0b\u5ea6\u306eLISTS\u5024\u3092\u63a8\u5968\u300d\u3068\u3042\u308b\u304c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210\u5f8c\u306b\u30c7\u30fc\u30bf\u304c\u5927\u5e45\u306b\u5897\u3048\u308b\u3068\u518d\u69cb\u7bc9\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002<\/p>\n<p>\u672c\u756a\u306b\u5207\u308a\u66ff\u3048\u30663\u65e5\u5f8c\u306e\u91d1\u66dc\u306e\u5348\u5f8c\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30d0\u30c3\u30c1\u30a4\u30f3\u30dd\u30fc\u30c8\u6a5f\u80fd\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u305f\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u5927\u91cf\u306ePDF\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u59cb\u3081\u3066\u3001\u30d9\u30af\u30c8\u30eb\u6570\u304c40\u4e07\u304b\u3089\u4e00\u6c17\u306b65\u4e07\u306b\u81a8\u3089\u3093\u3060\u3002\u305d\u306e\u77ac\u9593\u3001\u691c\u7d22\u306ep99\u304c800ms\u3092\u8d85\u3048\u305f\u3002<\/p>\n<p>\u539f\u56e0\u306f\u7d50\u5c40\u3001IVFFlat\u306eLISTS\u5024\u304c\u5b9f\u969b\u306e\u30d9\u30af\u30c8\u30eb\u6570\u3068\u5408\u308f\u306a\u304f\u306a\u3063\u3066\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u52b9\u7387\u304c\u843d\u3061\u305f\u3053\u3068\u2014\u2014\u3067\u306f\u306a\u304f\u3066\u3001\u8abf\u3079\u3066\u307f\u305f\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u305d\u3082\u305d\u3082\u4f7f\u308f\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u3002work_mem\u304c\u4f4e\u304f\u3066PostgreSQL\u304c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3088\u308a\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u9078\u3093\u3067\u3044\u305f\u3002<code>SET work_mem = '256MB'<\/code> \u3092\u30bb\u30c3\u30b7\u30e7\u30f3\u30ec\u30d9\u30eb\u3067\u8a66\u3057\u305f\u3089p99\u304c90ms\u306b\u623b\u3063\u305f\u304c\u3001\u3053\u308c\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30ec\u30d9\u30eb\u3067\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u3067\u3001\u305d\u306e\u65e5\u306f\u7d50\u5c40\u5bfe\u5fdc\u3067\u304d\u306a\u304b\u3063\u305f\u3002\u91d1\u66dc\u306e\u5348\u5f8c\u3060\u3063\u305f\u306e\u3067\u3001\u9031\u304c\u660e\u3051\u308b\u307e\u3067\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u3092\u5f37\u5316\u3057\u306a\u304c\u3089\u3072\u3084\u3072\u3084\u3057\u3066\u3044\u305f\u3002<\/p>\n<p>\u9031\u304c\u660e\u3051\u3066HNSW\u306b\u5207\u308a\u66ff\u3048\u305f\u3089\u554f\u984c\u306f\u89e3\u6d88\u3057\u305f\u3002HNSW\u306f\u30aa\u30f3\u30e9\u30a4\u30f3\u66f4\u65b0\u306b\u5f37\u304f\u3001\u30c7\u30fc\u30bf\u304c\u5897\u3048\u3066\u3082\u518d\u69cb\u7bc9\u304c\u4e0d\u8981\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210\u81ea\u4f53\u306f\u9045\u3044\u304c\uff0865\u4e07\u30d9\u30af\u30c8\u30eb\u3067\u7d0412\u5206\u304b\u304b\u3063\u305f\uff09\u3001\u4e00\u5ea6\u4f5c\u3063\u3066\u3057\u307e\u3048\u3070\u5b89\u5b9a\u3057\u3066\u3044\u308b\u3002<\/p>\n<p><code>m<\/code>\uff08\u5404\u30ce\u30fc\u30c9\u306e\u63a5\u7d9a\u6570\uff09\u3068<code>ef_construction<\/code>\uff08\u69cb\u7bc9\u6642\u306e\u30d3\u30fc\u30e0\u30b5\u30a4\u30ba\uff09\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff0816\u306864\uff09\u306f\u3001\u3046\u3061\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f\u5909\u66f4\u3057\u306a\u304b\u3063\u305f\u3002\u7cbe\u5ea6\u3092\u3055\u3089\u306b\u4e0a\u3052\u305f\u3051\u308c\u3070m\u3092\u5897\u3084\u3059\u304c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b5\u30a4\u30ba\u3068\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u306b\u306a\u308b\u3002100% recall\u304c\u5fc5\u8981\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306a\u3044\u306a\u3089\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5341\u5206\u3060\u3068\u601d\u3046\u3002<\/p>\n<h2>\u7d50\u5c40\u3046\u3061\u306fpgvector\u3067\u6b63\u89e3\u3060\u3063\u305f\u3001\u305f\u3060\u3057\u6761\u4ef6\u4ed8\u304d\u3067<\/h2>\n<p>\u30b3\u30b9\u30c8\u306f\u79fb\u884c\u5f8c\u3001$283\/\u6708 \u2192 \u307b\u307c\u30bc\u30ed\uff08RDS\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4ee3\u306f\u3082\u3068\u3082\u3068\u304b\u304b\u3063\u3066\u3044\u305f\u306e\u3067\uff09\u3002<\/p>\n<p>Pinecone\u3092\u9078\u3076\u3079\u304d\u30b1\u30fc\u30b9\u306f\u5b9f\u969b\u306b\u3042\u308b\u3002\u30d9\u30af\u30c8\u30eb\u6570\u304c\u5104\u5358\u4f4d\u306b\u306a\u3063\u3066\u304d\u305f\u3068\u304d\u3001PostgreSQL\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u3068\u30af\u30a8\u30ea\u6027\u80fd\u304c\u3069\u3053\u307e\u3067\u8010\u3048\u3089\u308c\u308b\u304b\u306f\u6b63\u76f4\u308f\u304b\u3089\u306a\u3044\u30021000\u4e07\u30d9\u30af\u30c8\u30eb\u304f\u3089\u3044\u307e\u3067\u306f\u554f\u984c\u306a\u3044\u3068\u3044\u3046\u4e8b\u4f8b\u3092\u898b\u304b\u3051\u308b\u304c\u3001\u305d\u308c\u4ee5\u4e0a\u306f\u81ea\u5206\u3067\u691c\u8a3c\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u78ba\u4fe1\u3092\u6301\u3066\u306a\u3044\u3002<\/p>\n<p>\u3042\u3068\u306f\u3001pgvector\u306fPostgreSQL\u306e\u904b\u7528\u77e5\u8b58\u304c\u5fc5\u8981\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3001work_mem\u306e\u8a2d\u5b9a\u3001VACUUM\u306e\u6319\u52d5\u2014\u2014\u3053\u308c\u3089\u3092\u77e5\u3089\u306a\u3044\u307e\u307e\u4f7f\u3044\u59cb\u3081\u308b\u3068\u79c1\u307f\u305f\u3044\u306bp99\u304c800ms\u306b\u306a\u308b\u3002Pinecone\u306f\u305d\u3046\u3044\u3046\u3053\u3068\u3092\u6c17\u306b\u3057\u306a\u304f\u3066\u3044\u3044\u3002\u305d\u308c\u306f\u3061\u3083\u3093\u3068\u3057\u305f\u4fa1\u5024\u3060\u3002<\/p>\n<p>\u305f\u3060\u3001\u3082\u3057\u4eca\u304b\u3089RAG\u3092\u69cb\u7bc9\u3059\u308b\u306a\u3089\u2014\u20143\u4eba\u30c1\u30fc\u30e0\u3067\u3001\u30d9\u30af\u30c8\u30eb\u6570\u304c\u6570\u767e\u4e07\u898f\u6a21\u4ee5\u4e0b\u3067\u3001\u3059\u3067\u306bPostgreSQL\u3092\u4f7f\u3063\u3066\u3044\u308b\u306a\u3089\u2014\u2014\u6700\u521d\u304b\u3089pgvector\u3067\u59cb\u3081\u308b\u3053\u3068\u3092\u52e7\u3081\u308b\u3002Pinecone\u306f\u5fc5\u8981\u306b\u306a\u3063\u3066\u304b\u3089\u79fb\u884c\u3092\u691c\u8a0e\u3059\u308c\u3070\u3044\u3044\u3002\u9006\u9806\u306e\u65b9\u304c\u697d\u3060\u3002<\/p>\n<p>Pinecone\u304b\u3089\u79fb\u884c\u3059\u308b\u5834\u5408\u3001\u30c7\u30fc\u30bf\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u306fAPI\u304b\u3089\u5168\u30d9\u30af\u30c8\u30eb\u3092\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u3057\u304b\u306a\u304f\u300140\u4e07\u4ef6\u3067\u7d041\u6642\u9593\u304b\u304b\u3063\u305f\u3002\u79fb\u884c\u30b9\u30af\u30ea\u30d7\u30c8\u81ea\u4f53\u306f\u5358\u7d14\u3060\u304c\u3001\u3053\u306e1\u6642\u9593\u3060\u3051\u306f\u899a\u609f\u3057\u3066\u304a\u304f\u3068\u3044\u3044\u3002\u3042\u3068\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u4e2d\u306bPinecone\u3078\u306e\u66f8\u304d\u8fbc\u307f\u304c\u8d70\u308b\u3068\u6574\u5408\u6027\u304c\u30ba\u30ec\u308b\u306e\u3067\u3001\u3067\u304d\u308c\u3070\u66f8\u304d\u8fbc\u307f\u505c\u6b62\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u53d6\u3063\u305f\u65b9\u304c\u3044\u3044\u2014\u2014\u3046\u3061\u306f\u6df1\u591c\u306b\u3084\u3063\u305f\u3002<\/p>\n<p><!-- Reviewed: 2026-03-09 | Status: ready_to_publish | Changes: added parenthetical aside on tier upgrade rationale, added \"\u62cd\u5b50\u629c\u3051\" reaction to setup section, strengthened A\/B results with pre-migration expectation, added IVFFlat hindsight aside, added Friday-night detail to incident, added export consistency warning to closing --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pinecone\u306e\u8acb\u6c42\u66f8\u3092\u958b\u3044\u305f\u306e\u306f\u53bb\u5e74\u306e9\u6708\u3067\u3001\u91d1\u984d\u306f$283\u3060\u3063\u305f\u3002 3\u4eba\u30c1\u30fc\u30e0\u3067\u793e\u5185\u5411\u3051\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u691c\u7d22\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u3044\u3066\u3001RAG\u306e\u30d9\u30af\u30c8\u30eb\u30b9\u30c8\u30a2\u3068\u3057\u3066Pinecone\u306eStarter \u2192 Standard\u3068\u4e57\u308a\u7d99\u3044\u3067\u304d\u305f\u3002\u30d9\u30af\u30c8\u30eb\u6570\u306f\u5f53\u6642\u7d0440\u4e07\u4ef6\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u306f1\u65e5\u305b\u3044\u305c\u3044500\u56de\u3002\u305d\u308c\u3067$280<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":1,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/197\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}