Академический Документы
Профессиональный Документы
Культура Документы
Julian Dyke
Independent Consultant
Web Version
Introduction
Logical I/Os
Buffer Cache Behaviour
Statistics
Conclusion
Externalized in
V$BUFFER_POOL
V$BUFFER_POOL_STATISTICS
Based on X$KCBWBPD
BH
cache
buffers
chain
latch
BH
Replacement MAIN
List
AUX
Write Buffer
MAIN Header
List
AUX
Object MAIN
List
AUX
Range MAIN
List
AUX
92
71
42 34
92
71 72
34
92 45
72
34 52
42
45
33
72
87
11 71
52
42
45
33
72
11 66
71
52
42
45
33
11 49
66
71
52
42
45
11
0 3
0 3
4
0 2
4 2
4
1 2
1
4 0
2
1 0
1
2
Read Block 87
11
42
33
34 Touch
42
33
87
11
Count
Get
Insert
Update
Move
Set
Gettouch
Insert
first
first
block
buffer
buffer
touch
buffer
available
available
count
71
42
at
atcount
contents
to
head
head
head
buffer
buffer
of
of cold
cold
from
end
for
of
on
from
endhot
block
block
cold
cold
end42
71
42
34
end
end
to zero 1
23 STOP
2005 Julian Dyke juliandyke.com
Consistent Reads
Current Block
Head of Head of Block Consistent Block
Hot End Cold End Number
40 56 17
27 34
17
27 27
34
17 95
27
34 33
95
27 85
33
95
132
128 132 150 150 150
System
Read Block 27 - SCN 128
132 Change
27
Number
Insert
Get
Read
Apply
first
current
consistent
buffer
undo
available
to
at
version
rollback
head
version
buffer
of
ofcold
of
from cold
block
end 27 SCN
to into
endbuffer
132
128 128
132
150
24 STOP
2005 Julian Dyke juliandyke.com
Multi-Block Reads
DB_FILE_MULTIBLOCK_READ_COUNT = 4
Head of Head of
Hot End Cold End
7
2
1
3
4
8
5
6 6
2
3
7
1
5 5
2
1
6 1
5 1
5 1
2
5
6 2
1
5
3
6
7 2
3
4
6
7
8
1
5
41
5 2
3
6 2
3
7 4
1
8
ReadBlock
Read Block7
28
5
6
1
3
4
Insert
Read
Move
Move
Get
Read
Insert
Move
Get next
next
block
buffers
next
block
block
buffers
first four
four
four
four 17
2
3
45
86available
at
to
available
to
to
at
blocks
blocks
head
cold
cold
cold
headend
end
of
end
into
of
into
cold
buffers
buffers
coldend
endfrom cold
from cold end
end
25 STOP
2005 Julian Dyke juliandyke.com
Dirty Blocks
When blocks are updated they are marked dirty
DBWn process
scans from cold end of MAIN replacement list
moves dirty blocks to auxiliary list
writes dirty blocks back to disk
Table T1
High Water
Mark
30 STOP
2005 Julian Dyke juliandyke.com
Full Table Scan - Summary
In Oracle 9.2
segment header initially read 3 times
segment header read again every 10 extents
Index I1
Branch
Block
Leaf
Blocks
Table T1
32 STOP
2005 Julian Dyke juliandyke.com
Index Organised Table
SELECT c2 FROM t1 WHERE c1 = 42; session logical reads 2
1
consistent gets 1
2
0 SELECT STATEMENT
1 0 INDEX (UNIQUE SCAN) OF 'I1' consistent gets - examination 2
1
index fetch by key 1
Index I1
Branch
Block
Leaf
Blocks
33 STOP
2005 Julian Dyke juliandyke.com
Single Table Hash Cluster
SELECT c2 FROM t1 WHERE c1 = 42; session logical reads 1
consistent gets 1
0 SELECT STATEMENT
1 0 TABLE ACCESS (HASH) OF 'T1' no work - consistent read gets 1
cluster key scans 1
cluster key scan block gets 1
Read Table Block 7 buffer is not pinned count 1
Data Block
Table T1
Leaf
Blocks
34 STOP
2005 Julian Dyke juliandyke.com
Clustering Factor
Measures relationship between index entries and
corresponding data blocks
Index I2
Branch
Block
Leaf
Blocks
Table T1
36 STOP
2005 Julian Dyke juliandyke.com
Range Scan - Good Clustering Factor
SELECT c2 FROM t1 WHERE c4 = 42; session logical reads 4
33
1
2
consistent gets 4
33
1
2
0 SELECT STATEMENT
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T1' consistent gets - examination 11
2 1 INDEX (RANGE SCAN) OF 'I3'
no work - consistent read gets 2
11
index scans kdiixs1 11
Read Table
Index Block 9
83
4
1 buffer is not pinned count 3
22
1
buffer is pinned count 9
6
7
8
42
3
51
Leaf Block
Data Block
Branch (Pinned)
(Pinned)
Block
table fetch by rowid 6
5
42
2
31
Index I3
Branch
Block
Leaf
Blocks
Table T1
37 STOP
2005 Julian Dyke juliandyke.com
Clustering Factor - Summary
Bad Good
Clustering Clustering
Factor Factor
session logical reads 8 4
consistent gets 8 4
consistent gets - examination 1 1
no work - consistent gets 6 2
index scans kdiixs1 1 1
buffer is not pinned count 7 3
buffer is pinned count 5 9
table fetch by rowid 6 6
Consistent Gets
3 337
4 276
5 227
10 130
20 82
50 53 Prefetch Size
100 43
250 37
500 35
1000 34
info@juliandyke.com
www.juliandyke.com