失效链接处理 |
索引内部原理 PDF 下载
本站整理下载:
提取码:12th
相关截图:
主要内容:
Treedump Trace Event
• Useful for determining current index structure
• Some earlier versions of Oracle can display a full
block dump of each leaf block
• Perfectly highlight indexes are “balanced” as the
number of levels to all leaf blocks is consistent
Richard Foote - Index Internals 10
SELECT object_id FROM dba_objects WHERE object_name = ‘index of interest’;
ALTER SESSION SET EVENTS ‘immediate trace name treedump level 12345’;
- where 12345 is the index object id
Example of Treedump
Richard Foote - Index Internals 11
----- begin tree dump
branch: 0x8405dde 138436062 (0: nrow: 3, level: 3)
branch: 0xdc11022 230756386 (-1: nrow: 219, level: 2)
branch: 0x8405f15 138436373 (-1: nrow: 138, level: 1)
leaf: 0x8405ddf 138436063 (-1: nrow: 21 rrow: 21)
leaf: 0x8405de0 138436064 (0: nrow: 18 rrow: 13)
leaf: 0x8405de2 138436066 (1: nrow: 15 rrow: 15)
block type (branch or leaf) and corresponding rdba,
position within previous level block (starting at –1 except root starting at 0)
nrows: number of all index entries (including deleted entries)
rrows: number of current index entries
level : branch block level (leaf block implicitly 0)
Note: Treedump trace file created in the USER_DUMP_DEST
Myth: Index becomes unbalanced
• Common perception that Oracle B-Tree Indexes
become unbalanced over time
• However, height between root block and all leaf
blocks is always consistent
• Treedump can highlight this
• Explored further in index block split discussion
|