{"id":2134,"date":"2025-06-23T12:19:34","date_gmt":"2025-06-23T04:19:34","guid":{"rendered":"http:\/\/www.821121.com\/?p=2134"},"modified":"2026-04-23T22:51:18","modified_gmt":"2026-04-23T14:51:18","slug":"23ai%e6%96%b0%e7%89%b9%e6%80%a7%e4%b9%8b%e5%90%91%e9%87%8f%e7%b4%a2%e5%bc%95","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=2134","title":{"rendered":"23ai\u65b0\u7279\u6027\u4e4b\u5411\u91cf\u7d22\u5f15"},"content":{"rendered":"<p>\u5411\u91cf\u68c0\u7d22\u7684\u6838\u5fc3\u662f\u5728\u9ad8\u7ef4\u7a7a\u95f4\u4e2d\u5feb\u901f\u627e\u5230\u4e0e\u76ee\u6807\u5411\u91cf\u76f8\u4f3c\u7684\u5411\u91cf\uff0c\u800c\u7d22\u5f15\u5219\u662f\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u7684\u5173\u952e\u3002Oracle 23ai \u539f\u751f\u5411\u91cf\u5f15\u64ce\u9488\u5bf9\u4e0d\u540c\u573a\u666f\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u4e3b\u6d41\u7684\u5411\u91cf\u7d22\u5f15\uff1aHNSW \u7d22\u5f15\u4e0eIVF-Flat \u7d22\u5f15\u3002<\/p>\n<h3>1. HNSW \u7d22\u5f15\uff1a\u5206\u5c42\u53ef\u5bfc\u822a\u5c0f\u4e16\u754c\u7d22\u5f15 \u2014\u2014 \u9ad8\u53ec\u56de\u7387\u7684\u9996\u9009<\/h3>\n<ul>\n<li>\u539f\u7406\uff1a<br \/>\nHNSW\uff08Hierarchical Navigable Small World\uff09\u662f\u57fa\u4e8e \u201c\u5c0f\u4e16\u754c\u7406\u8bba\u201d \u7684\u56fe\u7d22\u5f15\u7ed3\u6784\uff0c\u6838\u5fc3\u662f\u6784\u5efa\u591a\u5c42\u7ea7\u7684\u5411\u91cf\u56fe\uff1a<br \/>\n\u9876\u5c42\uff1a\u5c11\u91cf\u9ad8\u7ef4\u5411\u91cf\u8282\u70b9\uff0c\u4f5c\u4e3a \u201c\u5bfc\u822a\u5165\u53e3\u201d\uff0c\u8986\u76d6\u6574\u4e2a\u5411\u91cf\u7a7a\u95f4\uff1b<br \/>\n\u5e95\u5c42\uff1a\u6240\u6709\u5411\u91cf\u8282\u70b9\uff0c\u901a\u8fc7\u8fb9\u8fde\u63a5\u76f8\u4f3c\u5411\u91cf\uff1b<br \/>\n\u4e2d\u95f4\u5c42\uff1a\u8fc7\u6e21\u5c42\u7ea7\uff0c\u5e73\u8861\u9876\u5c42\u7684\u7c97\u68c0\u7d22\u4e0e\u5e95\u5c42\u7684\u7cbe\u68c0\u7d22\u3002<br \/>\n\u68c0\u7d22\u65f6\uff0c\u4ece\u9876\u5c42\u5165\u53e3\u8282\u70b9\u51fa\u53d1\uff0c\u9010\u5c42\u5411\u4e0b\u5bfc\u822a\uff0c\u5feb\u901f\u7f29\u5c0f\u68c0\u7d22\u8303\u56f4\uff0c\u6700\u7ec8\u5728\u5e95\u5c42\u627e\u5230\u76f8\u4f3c\u5411\u91cf\u3002\u8fd9\u79cd \u201c\u4ece\u7c97\u5230\u7cbe\u201d \u7684\u68c0\u7d22\u65b9\u5f0f\uff0c\u5927\u5e45\u51cf\u5c11\u4e86\u5411\u91cf\u8ddd\u79bb\u8ba1\u7b97\u7684\u6b21\u6570\u3002<\/li>\n<li>\u6838\u5fc3\u4f18\u52bf\uff1a<br \/>\n\u9ad8\u53ec\u56de\u7387\uff1a\u51e0\u4e4e\u80fd\u68c0\u7d22\u5230\u6240\u6709\u76f8\u4f3c\u5411\u91cf\uff0c\u65e0\u6f0f\u68c0\u95ee\u9898\uff1b<br \/>\n\u4f4e\u5ef6\u8fdf\uff1a\u4ebf\u7ea7\u5411\u91cf\u6570\u636e\u68c0\u7d22\u54cd\u5e94\u65f6\u95f4\u53ef\u63a7\u5236\u5728 10ms \u5185\uff1b<br \/>\n\u652f\u6301\u52a8\u6001\u63d2\u5165 \/ \u5220\u9664\uff1a\u5411\u91cf\u6570\u636e\u65b0\u589e \/ \u5220\u9664\u65f6\uff0c\u7d22\u5f15\u53ef\u5feb\u901f\u66f4\u65b0\uff0c\u9002\u914d\u5b9e\u65f6\u6570\u636e\u573a\u666f\u3002<\/li>\n<li>\u9002\u7528\u573a\u666f\uff1a<br \/>\n\u5bf9\u68c0\u7d22\u51c6\u786e\u7387\u8981\u6c42\u9ad8\u3001\u6570\u636e\u5b9e\u65f6\u66f4\u65b0\u7684\u573a\u666f\uff0c\u5982\u667a\u80fd\u5ba2\u670d\u8bed\u4e49\u68c0\u7d22\u3001\u4e2a\u6027\u5316\u63a8\u8350\u3001\u76f8\u4f3c\u6587\u672c\u67e5\u8be2\u3002<br \/>\n\u521b\u5efa\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-sql\">-- \u4e3a\u5546\u54c1\u8868\u7684\u63cf\u8ff0\u5411\u91cf\u521b\u5efaHNSW\u7d22\u5f15\nCREATE INDEX idx_products_hnsw ON products\nUSING VECTOR HNSW (description_emb VECTOR_COSINE_DISTANCE)\nWITH (DIMENSIONS=1536, M=16, EF_CONSTRUCTION=200);<\/code><\/pre>\n<p>M\uff1a\u6bcf\u4e2a\u8282\u70b9\u7684\u6700\u5927\u8fb9\u6570\uff0c\u503c\u8d8a\u5927\u7d22\u5f15\u7cbe\u5ea6\u8d8a\u9ad8\u4f46\u5b58\u50a8\u5f00\u9500\u8d8a\u5927\uff1b<br \/>\nEF_CONSTRUCTION\uff1a\u7d22\u5f15\u6784\u5efa\u65f6\u7684\u5019\u9009\u96c6\u5927\u5c0f\uff0c\u503c\u8d8a\u5927\u7d22\u5f15\u8d28\u91cf\u8d8a\u597d\u4f46\u6784\u5efa\u8017\u65f6\u8d8a\u957f\u3002<\/p>\n<h3>2. IVF-Flat \u7d22\u5f15\uff1a\u5012\u6392\u6587\u4ef6 + \u6241\u5e73\u5411\u91cf\u7d22\u5f15 \u2014\u2014 \u6d77\u91cf\u6570\u636e\u7684\u9ad8\u6548\u4e4b\u9009<\/h3>\n<\/li>\n<li>\u539f\u7406\uff1a<br \/>\nIVF-Flat\uff08Inverted File with Flat\uff09\u662f\u57fa\u4e8e \u201c\u805a\u7c7b\u201d \u7684\u7d22\u5f15\u7ed3\u6784\uff0c\u6838\u5fc3\u5206\u4e3a\u4e24\u6b65\uff1a<br \/>\n\u7d22\u5f15\u6784\u5efa\u9636\u6bb5\uff1a\u901a\u8fc7\u805a\u7c7b\u7b97\u6cd5\uff08\u5982 K-Means\uff09\u5c06\u6240\u6709\u5411\u91cf\u5212\u5206\u4e3a\u591a\u4e2a \u201c\u805a\u7c7b\u4e2d\u5fc3\u201d\uff0c\u6bcf\u4e2a\u5411\u91cf\u5f52\u5c5e\u5230\u6700\u8fd1\u7684\u805a\u7c7b\u4e2d\u5fc3\uff0c\u5f62\u6210 \u201c\u5012\u6392\u6587\u4ef6\u201d\uff08\u8bb0\u5f55\u6bcf\u4e2a\u805a\u7c7b\u5305\u542b\u7684\u5411\u91cf\uff09\uff1b<br \/>\n\u68c0\u7d22\u9636\u6bb5\uff1a\u5148\u8ba1\u7b97\u76ee\u6807\u5411\u91cf\u4e0e\u5404\u805a\u7c7b\u4e2d\u5fc3\u7684\u8ddd\u79bb\uff0c\u7b5b\u9009\u51fa Top-N \u4e2a\u76f8\u4f3c\u805a\u7c7b\uff0c\u518d\u5728\u8fd9\u4e9b\u805a\u7c7b\u4e2d\u9010\u4e00\u8ba1\u7b97\u5411\u91cf\u8ddd\u79bb\uff0c\u627e\u5230\u6700\u7ec8\u76f8\u4f3c\u5411\u91cf\u3002<\/li>\n<li>\u6838\u5fc3\u4f18\u52bf\uff1a<br \/>\n\u6d77\u91cf\u6570\u636e\u9002\u914d\uff1a\u652f\u6301\u5341\u4ebf\u7ea7\u5411\u91cf\u6570\u636e\u5b58\u50a8\u4e0e\u68c0\u7d22\uff0c\u5b58\u50a8\u4e0e\u8ba1\u7b97\u5f00\u9500\u8fdc\u4f4e\u4e8e HNSW\uff1b<br \/>\n\u9ad8\u541e\u5410\u91cf\uff1a\u6279\u91cf\u68c0\u7d22\u573a\u666f\u4e0b\u6027\u80fd\u66f4\u4f18\uff0c\u9002\u5408\u5927\u6570\u636e\u91cf\u7684\u79bb\u7ebf\u5206\u6790\u3002<\/li>\n<li>\u9002\u7528\u573a\u666f\uff1a<br \/>\n\u6570\u636e\u91cf\u8d85\u4ebf\u7ea7\u3001\u5bf9\u68c0\u7d22\u901f\u5ea6\u8981\u6c42\u9ad8\u4e8e\u53ec\u56de\u7387\u7684\u573a\u666f\uff0c\u5982\u533b\u7597\u5f71\u50cf\u76f8\u4f3c\u75c5\u4f8b\u68c0\u7d22\u3001\u5de5\u4e1a\u4f20\u611f\u5668\u65f6\u5e8f\u5411\u91cf\u68c0\u7d22\u3001\u5927\u89c4\u6a21\u65e5\u5fd7\u5411\u91cf\u5206\u6790\u3002<br \/>\n\u521b\u5efa\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-sql\">-- \u4e3a\u533b\u7597\u5f71\u50cf\u8868\u7684\u5f71\u50cf\u5411\u91cf\u521b\u5efaIVF-Flat\u7d22\u5f15\nCREATE INDEX idx_medical_images_ivf ON medical_images\nUSING VECTOR IVF (image_emb VECTOR_EUCLIDEAN_DISTANCE)\nWITH (DIMENSIONS=512, NUM_CLUSTERS=1024);<\/code><\/pre>\n<p>NUM_CLUSTERS\uff1a\u805a\u7c7b\u4e2d\u5fc3\u6570\u91cf\uff0c\u901a\u5e38\u5efa\u8bae\u4e3a\u5411\u91cf\u603b\u6570\u7684 1\/1000~1\/100\uff0c\u5e73\u8861\u68c0\u7d22\u901f\u5ea6\u4e0e\u51c6\u786e\u7387\u3002<\/p>\n<\/li>\n<li>\u603b\u7ed3\uff1a\u6280\u672f\u62c6\u89e3\u80cc\u540e\u7684\u843d\u5730\u903b\u8f91<br \/>\nVECTOR \u6570\u636e\u7c7b\u578b\u89e3\u51b3\u4e86\u5411\u91cf \u201c\u5b58\u5f97\u4e0b\u3001\u7b97\u5f97\u52a8\u201d \u7684\u95ee\u9898\uff0c\u800c HNSW \u4e0e IVF-Flat \u7d22\u5f15\u5219\u89e3\u51b3\u4e86\u5411\u91cf \u201c\u67e5\u5f97\u5feb\u201d \u7684\u95ee\u9898\u3002\u5f00\u53d1\u8005\u53ef\u6839\u636e\u81ea\u8eab\u4e1a\u52a1\u573a\u666f\u7684\u6570\u636e\u91cf\u3001\u53ec\u56de\u7387\u8981\u6c42\u3001\u5b9e\u65f6\u6027\u9700\u6c42\uff0c\u7075\u6d3b\u9009\u62e9\u7d22\u5f15\u7c7b\u578b\uff0c\u65e0\u9700\u5728\u6027\u80fd\u4e0e\u6210\u672c\u4e4b\u95f4\u59a5\u534f\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5411\u91cf\u68c0\u7d22\u7684\u6838\u5fc3\u662f\u5728\u9ad8\u7ef4\u7a7a\u95f4\u4e2d\u5feb\u901f\u627e\u5230\u4e0e\u76ee\u6807\u5411\u91cf\u76f8\u4f3c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57,58],"tags":[],"class_list":["post-2134","post","type-post","status-publish","format-standard","hentry","category-oracle-23ai","category--oracle-23c"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/2134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2134"}],"version-history":[{"count":1,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/2134\/revisions"}],"predecessor-version":[{"id":2135,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/2134\/revisions\/2135"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2134"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}