{"id":96010,"date":"2024-10-20T05:51:16","date_gmt":"2024-10-19T21:51:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/96010\/"},"modified":"2024-10-20T05:51:17","modified_gmt":"2024-10-19T21:51:17","slug":"oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e4%b8%ad%e6%80%8e%e6%a8%a3%e9%81%b8%e6%93%87%e5%90%88%e9%81%a9%e7%b4%a2%e5%bc%95%e9%a1%9e%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/96010\/","title":{"rendered":"Oracle\u6578\u64da\u5eab\u4e2d\u600e\u6a23\u9078\u64c7\u5408\u9069\u7d22\u5f15\u985e\u578b"},"content":{"rendered":"<h1 id=\"oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e4%b8%ad%e6%80%8e%e6%a8%a3%e9%81%b8%e6%93%87%e5%90%88%e9%81%a9%e7%b4%a2%e5%bc%95%e9%a1%9e%e5%9e%8b-UbujuUntfv\">Oracle\u6578\u64da\u5eab\u4e2d\u600e\u6a23\u9078\u64c7\u5408\u9069\u7d22\u5f15\u985e\u578b<\/h1>\n<p>\u5728Oracle\u6578\u64da\u5eab\u4e2d\uff0c\u7d22\u5f15\u662f\u4e00\u7a2e\u91cd\u8981\u7684\u6578\u64da\u7d50\u69cb\uff0c\u7528\u65bc\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u3002\u9078\u64c7\u5408\u9069\u7684\u7d22\u5f15\u985e\u578b\u5c0d\u65bc\u512a\u5316\u6578\u64da\u5eab\u6027\u80fd\u81f3\u95dc\u91cd\u8981\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u4e0d\u540c\u7684\u7d22\u5f15\u985e\u578b\u53ca\u5176\u9069\u7528\u5834\u666f\uff0c\u5e6b\u52a9\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u548c\u958b\u767c\u8005\u505a\u51fa\u660e\u667a\u7684\u9078\u64c7\u3002<\/p>\n<h2 id=\"%e7%b4%a2%e5%bc%95%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-UbujuUntfv\">\u7d22\u5f15\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>\u7d22\u5f15\u662f\u4e00\u7a2e\u6578\u64da\u7d50\u69cb\uff0c\u80fd\u5920\u52a0\u901f\u67e5\u8a62\u64cd\u4f5c\u3002\u5b83\u985e\u4f3c\u65bc\u66f8\u7c4d\u7684\u76ee\u9304\uff0c\u5e6b\u52a9\u7528\u6236\u5feb\u901f\u627e\u5230\u6240\u9700\u7684\u4fe1\u606f\u3002\u5728Oracle\u4e2d\uff0c\u7d22\u5f15\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\uff0c\u4f46\u4e0d\u7576\u4f7f\u7528\u4e5f\u53ef\u80fd\u5c0e\u81f4\u6027\u80fd\u4e0b\u964d\u3002\u56e0\u6b64\uff0c\u9078\u64c7\u5408\u9069\u7684\u7d22\u5f15\u985e\u578b\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e7%9a%84%e7%b4%a2%e5%bc%95%e9%a1%9e%e5%9e%8b-UbujuUntfv\">\u5e38\u898b\u7684\u7d22\u5f15\u985e\u578b<\/h2>\n<h3 id=\"1-b%e6%a8%b9%e7%b4%a2%e5%bc%95-UbujuUntfv\">1. B\u6a39\u7d22\u5f15<\/h3>\n<p>B\u6a39\u7d22\u5f15\u662fOracle\u4e2d\u6700\u5e38\u7528\u7684\u7d22\u5f15\u985e\u578b\u3002\u5b83\u9069\u7528\u65bc\u5927\u591a\u6578\u67e5\u8a62\uff0c\u7279\u5225\u662f\u7bc4\u570d\u67e5\u8a62\u3002B\u6a39\u7d22\u5f15\u7684\u7d50\u69cb\u4f7f\u5f97\u67e5\u8a62\u64cd\u4f5c\u7684\u6642\u9593\u8907\u96dc\u5ea6\u70baO(log n)\uff0c\u9019\u4f7f\u5f97\u5b83\u5728\u8655\u7406\u5927\u91cf\u6578\u64da\u6642\u975e\u5e38\u9ad8\u6548\u3002<\/p>\n<pre><code>CREATE INDEX idx_example ON table_name(column_name);<\/code><\/pre>\n<h3 id=\"2-%e4%bd%8d%e5%9c%96%e7%b4%a2%e5%bc%95-UbujuUntfv\">2. \u4f4d\u5716\u7d22\u5f15<\/h3>\n<p>\u4f4d\u5716\u7d22\u5f15\u9069\u5408\u65bc\u4f4e\u57fa\u6578\u7684\u5217\uff08\u5373\u5217\u4e2d\u4e0d\u540c\u503c\u7684\u6578\u91cf\u8f03\u5c11\uff09\u3002\u5b83\u4f7f\u7528\u4f4d\u5716\u4f86\u8868\u793a\u6bcf\u500b\u503c\u7684\u5b58\u5728\u8207\u5426\uff0c\u5f9e\u800c\u5728\u67e5\u8a62\u6642\u80fd\u5920\u5feb\u901f\u904e\u6ffe\u6578\u64da\u3002\u4f4d\u5716\u7d22\u5f15\u5728\u9032\u884c\u8907\u96dc\u67e5\u8a62\u6642\uff08\u5982\u591a\u500b\u689d\u4ef6\u7684\u7d44\u5408\u67e5\u8a62\uff09\u8868\u73fe\u5c24\u70ba\u51fa\u8272\u3002<\/p>\n<pre><code>CREATE BITMAP INDEX idx_example ON table_name(column_name);<\/code><\/pre>\n<h3 id=\"3-%e5%94%af%e4%b8%80%e7%b4%a2%e5%bc%95-UbujuUntfv\">3. \u552f\u4e00\u7d22\u5f15<\/h3>\n<p>\u552f\u4e00\u7d22\u5f15\u78ba\u4fdd\u7d22\u5f15\u5217\u4e2d\u7684\u6bcf\u500b\u503c\u90fd\u662f\u552f\u4e00\u7684\u3002\u9019\u4e0d\u50c5\u63d0\u9ad8\u4e86\u67e5\u8a62\u6027\u80fd\uff0c\u9084\u80fd\u4fdd\u8b49\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002\u552f\u4e00\u7d22\u5f15\u901a\u5e38\u7528\u65bc\u4e3b\u9375\u6216\u9700\u8981\u552f\u4e00\u6027\u7684\u5217\u3002<\/p>\n<pre><code>CREATE UNIQUE INDEX idx_example ON table_name(column_name);<\/code><\/pre>\n<h3 id=\"4-%e5%87%bd%e6%95%b8%e7%b4%a2%e5%bc%95-UbujuUntfv\">4. \u51fd\u6578\u7d22\u5f15<\/h3>\n<p>\u51fd\u6578\u7d22\u5f15\u5141\u8a31\u5728\u7d22\u5f15\u4e2d\u4f7f\u7528\u8868\u9054\u5f0f\u6216\u51fd\u6578\u7684\u7d50\u679c\u3002\u9019\u5c0d\u65bc\u9700\u8981\u5c0d\u5217\u9032\u884c\u8a08\u7b97\u6216\u8f49\u63db\u7684\u67e5\u8a62\u975e\u5e38\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5c0d\u65bc\u5b58\u5132\u65e5\u671f\u7684\u5217\uff0c\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u51fd\u6578\u7d22\u5f15\u4f86\u52a0\u901f\u57fa\u65bc\u5e74\u4efd\u7684\u67e5\u8a62\u3002<\/p>\n<pre><code>CREATE INDEX idx_example ON table_name(UPPER(column_name));<\/code><\/pre>\n<h2 id=\"%e9%81%b8%e6%93%87%e5%90%88%e9%81%a9%e7%b4%a2%e5%bc%95%e7%9a%84%e8%80%83%e9%87%8f%e5%9b%a0%e7%b4%a0-UbujuUntfv\">\u9078\u64c7\u5408\u9069\u7d22\u5f15\u7684\u8003\u91cf\u56e0\u7d20<\/h2>\n<ul>\n<li><strong>\u67e5\u8a62\u6a21\u5f0f\uff1a<\/strong>\u5206\u6790\u67e5\u8a62\u7684\u985e\u578b\u548c\u983b\u7387\uff0c\u9078\u64c7\u6700\u80fd\u63d0\u9ad8\u6027\u80fd\u7684\u7d22\u5f15\u985e\u578b\u3002<\/li>\n<li><strong>\u6578\u64da\u5206\u4f48\uff1a<\/strong>\u8003\u616e\u5217\u7684\u57fa\u6578\uff0c\u4f4e\u57fa\u6578\u5217\u9069\u5408\u4f7f\u7528\u4f4d\u5716\u7d22\u5f15\uff0c\u800c\u9ad8\u57fa\u6578\u5217\u5247\u9069\u5408\u4f7f\u7528B\u6a39\u7d22\u5f15\u3002<\/li>\n<li><strong>\u7dad\u8b77\u6210\u672c\uff1a<\/strong>\u7d22\u5f15\u6703\u589e\u52a0\u6578\u64da\u63d2\u5165\u3001\u66f4\u65b0\u548c\u522a\u9664\u7684\u6210\u672c\uff0c\u56e0\u6b64\u9700\u8981\u5e73\u8861\u67e5\u8a62\u6027\u80fd\u548c\u7dad\u8b77\u6210\u672c\u3002<\/li>\n<li><strong>\u6578\u64da\u91cf\uff1a<\/strong>\u5c0d\u65bc\u5927\u6578\u64da\u96c6\uff0c\u9078\u64c7\u5408\u9069\u7684\u7d22\u5f15\u985e\u578b\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u67e5\u8a62\u6548\u7387\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-UbujuUntfv\">\u7d50\u8ad6<\/h2>\n<p>\u5728Oracle\u6578\u64da\u5eab\u4e2d\uff0c\u9078\u64c7\u5408\u9069\u7684\u7d22\u5f15\u985e\u578b\u662f\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u7684\u95dc\u9375\u3002B\u6a39\u7d22\u5f15\u3001\u4f4d\u5716\u7d22\u5f15\u3001\u552f\u4e00\u7d22\u5f15\u548c\u51fd\u6578\u7d22\u5f15\u5404\u6709\u5176\u9069\u7528\u5834\u666f\uff0c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u61c9\u6839\u64da\u5177\u9ad4\u9700\u6c42\u9032\u884c\u9078\u64c7\u3002\u901a\u904e\u5408\u7406\u7684\u7d22\u5f15\u8a2d\u8a08\uff0c\u53ef\u4ee5\u986f\u8457\u63d0\u5347\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u6548\u7387\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc\u6578\u64da\u5eab\u7ba1\u7406\u548c\u512a\u5316\u7684\u8cc7\u8a0a\uff0c\u60a8\u53ef\u4ee5\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\uff0c\u7372\u53d6\u66f4\u591a\u95dc\u65bc<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u548c<a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a>\u7684\u8a73\u7d30\u8cc7\u6599\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728Oracle\u6578\u64da\u5eab\u4e2d\u9078\u64c7\u5408\u9069\u7684\u7d22\u5f15\u985e\u578b\uff0c\u4ee5\u63d0\u5347\u67e5\u8a62\u6027\u80fd\u548c\u6578\u64da\u5b58\u53d6\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-96010","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=96010"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96010\/revisions"}],"predecessor-version":[{"id":96011,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96010\/revisions\/96011"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=96010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=96010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=96010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}