How Indexes Grow and Pctfree
Indexes are always balanced and they grow from the bottom up. As rows are added, the leaf block fills. When the leaf block is full, the Oracle server splits it into two blocks and puts 50% of the block’s contents into the original leaf block and 50% into a new leaf block.
If another block is added to the index, this newly added block must be added to the directory entry in the parent branch block. If this parent branch block is full, the parent branch block is split in a similar way to the leaf block, with 50% of the existing contents being divided between the existing and new branch blocks. If required, this pattern is repeated until the place where the root block becomes a branch block and a new root block is added.
索引從下往上增長的時候總是會被平衡,當一個行增加時,leaf block被填充,當leaf block被填滿後,oracle server 把該block一分為二並各放50%的資料。當有新的塊被增加到索引時,這個新增的塊必須在父的branch block中增加一條directory entry,當父的branch block被填滿後,branch block就像leaf block一樣,分成兩個branch block並各有50%的資料,如果需要的話,這樣模式會一直被重複,直到root block成為一個branch block並有一個新的root block被增加。
The more levels an index has, the less efficient it may be. Additionally, an index with many rows deleted might not be efficient. Typically, if 15% of the index data is deleted, then you should consider rebuilding the index.
如果索引的層次較多,那麼它的效率就不那麼好了,另外一個被刪除很多列的索引也不會那麼有效,如果一個索引的15%的資料被刪除,那麼就需要考慮重建索引了。重建索引比先刪除索引再建立索引效率要高的多。
http://www.itpub.net/showthread.php?s=&postid=2135062#post2135062
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84268/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How PCTFREE and PCTUSED Work Together(十)
- How Indexes Are Stored (206)Index
- GROW模型(轉載)模型
- Oracle pctfree 和 pctusedOracle
- oracle pctfree與pctusedOracle
- CSS flex-grow 屬性CSSFlex
- Rebuild IndexesRebuildIndex
- ORACLE INDEXESOracleIndex
- oracle pctfree和pctused詳解Oracle
- pctfree和pctused的區別。
- PCTFREE, PCTUSED, and Row Chaining(七)AI
- Oracle - Tables/IndexesOracleIndex
- 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
- skip_unusable_indexesIndex
- The Secrets of Oracle Bitmap IndexesOracleIndex
- Restrictions on Create Bitmap IndexesRESTIndex
- Global Range Partitioned IndexesIndex
- Global Hash Partitioned IndexesIndex
- Maintenance of Global Partitioned IndexesAINaNIndex
- Overview of Indexes (194)ViewIndex
- Indexes and Nulls (198)IndexNull
- Oracle資料庫的PCTFREE與PCTUSEDOracle資料庫
- 「Grow」CSP初賽 2024 可樂消失記
- Sparse Indexes vs unique indexIndex
- SKIP_UNUSABLE_INDEXES InitializationIndex
- Choosing Composite IndexesIndex
- 建立Function-Based IndexesFunctionIndex
- Bitmap Indexes and Nulls (224)IndexNull
- Partitioned Indexes on Composite PartitionsIndex
- 慎用 skip_unused_indexesIndex
- Delete indexes to free database.deleteIndexDatabase
- Unique and Nonunique Indexes (195)Index