程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> Oracleindexunusable和invisible的區別

Oracleindexunusable和invisible的區別

編輯:Oracle教程

Oracleindexunusable和invisible的區別


摘錄自11g的官方文檔:

UNUSABLE Specify UNUSABLE to mark the index or index partition(s) or index subpartition(s) UNUSABLE. The space allocated for an index or index partition or subpartition is freed immediately when the object is marked UNUSABLE. An unusable index must be rebuilt, or dropped and re-created, before it can be used. While one partition is marked UNUSABLE, the other partitions of the index are still valid. You can execute statements that require the index if the statements do not access the unusable partition. You can also split or rename the unusable partition before rebuilding it. Refer to CREATE INDEX ... UNUSABLE for more information.

An index that is not maintained by DML operations and is ignored by the optimizer. All indexes are usable (default) or unusable.

VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level.

unusable index 是被優化器所忽略,並且不被dml操作維護,如果索引被unusable後,需要重建。

invisible index會被優化器所忽略,但是dml操作仍然會維護索引。在session或者system級別使用參數OPTIMIZER_USE_INVISIBLE_INDEXES=true,那麼優化器會考慮使用invisible index。適用於查看索引是否被正在的使用上。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved