Secondary Indexes on Index-Organized Tables (231)
Secondary index support on index-organized tables provides efficient access to
index-organized table using columns that are not the primary key nor a prefix of the
primary key.
Oracle constructs secondary indexes on index-organized tables using logical row
identifiers (logical rowids) that are based on the table's primary key. A logical rowid
includes a physical guess, which identifies the block location of the row. Oracle can
use these physical guesses to probe directly into the leaf block of the index-organized
table, bypassing the primary key search. Because rows in index-organized tables do
not have permanent physical addresses, the physical guesses can become stale when
rows are moved to new blocks.
For an ordinary table, access by a secondary index involves a scan of the secondary
index and an additional I/O to fetch the data block containing the row. For
index-organized tables, access by a secondary index varies, depending on the use and
accuracy of physical guesses:
■ Without physical guesses, access involves two index scans: a secondary index scan
followed by a scan of the primary key index.
■ With accurate physical guesses, access involves a secondary index scan and an
additional I/O to fetch the data block containing the row.
■ With inaccurate physical guesses, access involves a secondary index scan and an
I/O to fetch the wrong data block (as indicated by the physical guess), followed by
a scan of the primary key index.
索引組織表中的(二級索引)?
1. Oracle 為索引組織表建立二級索引時使用的是邏輯 rorwid,邏輯 rowid
是根據索引組織表的主鍵生成的。
Oracle 能夠根據邏輯 rowid 進行物理推測,以確定索引項在索引塊中的物理位置。
因此 Oracle
能夠繞過主鍵搜尋,透過物理推測直接訪問索引組織表的葉塊。由於索引組織表的資料行沒有固定的實體地址,
當索引項被移動到新的索引塊後,物理推測的結果會出現錯誤,此時 Oracle 仍需要執行主鍵搜尋。
2. 對一個常規表來說,透過間接索引訪問表資料意味著先掃描間接索引再獲取包含所需資料行的資料塊
3.
對於索引組織表來說,透過間接索引訪問表資料的步驟依據是否使用物理推測,及物理推測的準確度而有所不同
* 如不使用物理推測,資料訪問需要兩次索引掃描:首先掃描間接索引,再依據其結果掃描主鍵索引
* 如使用物理推測且推測結果準確,資料訪問需要首先掃描間接索引,再進行 I/O
操作獲取包含所需資料行的資料塊
* 如使用物理推測且推測結果不準確,資料訪問需要首先掃描間接索引,並執行 I/O
操作獲取了錯誤的資料塊,之後再進行主鍵索引掃描。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-983119/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Bitmap Indexes on Index-Organized Tables (232)IndexZed
- Oracle 19c Concepts(03):Indexes and Index-Organized TablesOracleIndexZed
- B-tree Indexes on UROWID Columns for Heap- and Index-Organized Tables (235)IndexZed
- Oracle - Tables/IndexesOracleIndex
- Creating Secondary IndexesIndex
- Overview of Index-Organized Tables (227)ViewIndexZed
- Benefits of Index-Organized Tables (229)IndexZed
- Partitioned Index-Organized Tables (234)IndexZed
- The differences between index-organized tables and ordinary tables (228)IndexZed
- Bitmap Indexes on Partitioned Tables (225)Index
- Index-Organized Tables with Row Overflow Area (230)IndexZed
- ORA-29857: domain indexes and/or secondary objects exist in the tablespaceAIIndexObject
- Creating Compressed Tables and IndexesIndex
- Allocation of Temporary Segments for Temporary Tables and Indexes (28)Index
- Validating Tables, Indexes, Clusters, and Materialized ViewsIndexZedView
- Miscellaneous Information about Creating Indexes on Partitioned TablesORMIndex
- Use the following approach to create tables with constraints and indexes:APPAIIndex
- 關於分割槽表和分割槽索引(About Partitioned Tables and Indexes)索引Index
- 高效的SQL(Index-Organized Tables優化精確查詢和範圍查詢)SQLIndexZed優化
- [20130812]12c Partial Indexes For Partitioned Tables Part I.txtIndex
- [20130812]12c Partial Indexes For Partitioned Tables Part II.txtIndex
- Examples of Secondary IndexIndex
- Rebuild IndexesRebuildIndex
- ORACLE INDEXESOracleIndex
- dba_tables,dba_all_tables,user_tables,all_tables有什麼區別
- Oracle Index-organized table (IOT)概述OracleIndexZed
- Index-Organized Table Applications (236)IndexZedAPP
- Oracle TablesOracle
- Reverse Key IndexesIndex
- ORACLE -> NULL & INDEXESOracleNullIndex
- Overview of Partitioned IndexesViewIndex
- Local Partitioned IndexesIndex
- Global Nonpartitioned IndexesIndex
- Extents in Indexes (19)Index
- 翻譯(九)——Clustered Indexes: Stairway to SQL Server Indexes Level 3IndexAISQLServer
- What is meant by Primary Index and Secondary IndexIndex
- Oracle Externale TablesOracle
- Oracle X$TablesOracle