{"id":15777,"date":"2023-12-04T22:46:03","date_gmt":"2023-12-04T14:46:03","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15777"},"modified":"2023-12-04T22:51:24","modified_gmt":"2023-12-04T14:51:24","slug":"oracle-zhong-qing-jie-shi-mei-zhong-suo-yin-bing-x","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-qing-jie-shi-mei-zhong-suo-yin-bing-x\/","title":{"rendered":"Oracle \u4e2d\u8bf7\u89e3\u91ca\u6bcf\u79cd\u7d22\u5f15\uff0c\u5e76\u5199\u51fa\u5176\u8bed\u6cd5\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\u5305\u62ec\uff1a<strong>B \u6811\u7d22\u5f15\uff08B-tree Index\uff09<\/strong>\u3001<strong>\u4f4d\u56fe\u7d22\u5f15\uff08Bitmap Index\uff09<\/strong>\u3001<strong>\u552f\u4e00\u7d22\u5f15\uff08Unique Index\uff09<\/strong>\u3001<strong>\u4f4d\u56fe\u5408\u5e76\u7d22\u5f15\uff08Bitmap Join Index\uff09<\/strong>\u3002\u4ee5\u4e0b\u662f\u6bcf\u79cd\u7d22\u5f15\u7684\u7b80\u8981\u89e3\u91ca\u548c\u8bed\u6cd5\uff1a<\/p>\n<h3>1. B \u6811\u7d22\u5f15\uff08B-tree Index\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u89e3\u91ca\uff1a<\/strong>\n<ul>\n<li>B \u6811\u7d22\u5f15\u662f\u6700\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u7528\u4e8e\u52a0\u901f\u6570\u636e\u7684\u67e5\u627e\u3002\u5b83\u901a\u8fc7\u6784\u5efa\u4e00\u9897\u5e73\u8861\u7684 B \u6811\u6765\u5b58\u50a8\u7d22\u5f15\u952e\u548c\u5bf9\u5e94\u7684\u884c\u5730\u5740\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8bed\u6cd5\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">CREATE INDEX index_name\nON table_name (column1, column2, ...);\n<\/code><\/pre>\n<ul>\n<li>\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-sql  line-numbers\">CREATE INDEX idx_employee_name\nON employees (last_name, first_name);\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>2. \u4f4d\u56fe\u7d22\u5f15\uff08Bitmap Index\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u89e3\u91ca\uff1a<\/strong>\n<ul>\n<li>\u4f4d\u56fe\u7d22\u5f15\u9002\u7528\u4e8e\u4f4e\u57fa\u6570\u5217\uff0c\u5b83\u5c06\u6bcf\u4e2a\u4e0d\u540c\u7684\u5217\u503c\u6620\u5c04\u5230\u4e00\u4e2a\u4f4d\u56fe\uff0c\u6bcf\u4e2a\u4f4d\u4ee3\u8868\u4e00\u4e2a\u884c\u7684\u5b58\u5728\u6216\u7f3a\u5931\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8bed\u6cd5\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">CREATE BITMAP INDEX index_name\nON table_name (column1, column2, ...);\n<\/code><\/pre>\n<ul>\n<li>\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-sql  line-numbers\">CREATE BITMAP INDEX idx_employee_gender\nON employees (gender);\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>3. \u552f\u4e00\u7d22\u5f15\uff08Unique Index\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u89e3\u91ca\uff1a<\/strong>\n<ul>\n<li>\u552f\u4e00\u7d22\u5f15\u786e\u4fdd\u7d22\u5f15\u5217\u4e2d\u7684\u6240\u6709\u503c\u90fd\u662f\u552f\u4e00\u7684\uff0c\u4e0d\u5141\u8bb8\u91cd\u590d\u503c\u5b58\u5728\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8bed\u6cd5\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">CREATE UNIQUE INDEX index_name\nON table_name (column1, column2, ...);\n<\/code><\/pre>\n<ul>\n<li>\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-sql  line-numbers\">CREATE UNIQUE INDEX idx_employee_id\nON employees (employee_id);\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>4. \u4f4d\u56fe\u5408\u5e76\u7d22\u5f15\uff08Bitmap Join Index\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u89e3\u91ca\uff1a<\/strong>\n<ul>\n<li>\u4f4d\u56fe\u5408\u5e76\u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7c7b\u578b\u7684\u4f4d\u56fe\u7d22\u5f15\uff0c\u7528\u4e8e\u591a\u8868\u8fde\u63a5\uff0c\u901a\u8fc7\u5c06\u591a\u4e2a\u4f4d\u56fe\u5408\u5e76\u6210\u4e00\u4e2a\u6765\u52a0\u901f\u8fde\u63a5\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8bed\u6cd5\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">CREATE BITMAP INDEX index_name\nON table_name\nFROM table1_name, table2_name, ...;\n<\/code><\/pre>\n<ul>\n<li>\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-sql  line-numbers\">CREATE BITMAP INDEX idx_employee_department\nON employees\nFROM employees, departments\nWHERE employees.department_id = departments.department_id;\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\u53ca\u5176\u7b80\u8981\u89e3\u91ca\u548c\u8bed\u6cd5\u3002\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u6839\u636e\u67e5\u8be2\u9700\u6c42\u548c\u6570\u636e\u6a21\u578b\u7684\u7279\u70b9\uff0c\u9009\u62e9\u5408\u9002\u7684\u7d22\u5f15\u7c7b\u578b\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\u5305\u62ec\uff1aB \u6811\u7d22\u5f15\uff08B-tree Index\uff09\u3001\u4f4d\u56fe\u7d22\u5f15\uff08Bitmap [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15777","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15777"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15777\/revisions"}],"predecessor-version":[{"id":15778,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15777\/revisions\/15778"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15777"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}