1 / 44
Access Methods
Access Methods 1 / 44 Recap Recap 2 / 44 Recap A More Detailed - - PowerPoint PPT Presentation
Access Methods Access Methods 1 / 44 Recap Recap 2 / 44 Recap A More Detailed Architecture granularity: relation, view, ... application Query Interface SQL,... granularity: relation, view, ... data structures: logical schema, logical
1 / 44
Access Methods
2 / 44
Recap
3 / 44
Recap
DB granularity: data structures: granularity: block, file free space inventory, extent table ... track, cylinder, ... granularity: data structures: granularity: page, segment page table, block map ... block, file granularity: data structures: granularity: physical record,... free space inventory, page indexes ... page, segment granularity: data structures: granularity: logical record, key,... access path, physical schema ... physical record, ... granularity: data structures: granularity: relation, view, ... logical schema, integrity constraints logical record, key, ... granularity: relation, view, ... Device Interface File Interface DB Buffer Record Access Record Interface Query Interface SQL,... FIND NEXT record, STORE record write record, insert in B-tree,... access page j, release page j read block k, write block k application logical data access paths physical data page structure storage allocation external storage
4 / 44
Recap
▶ Connection Manager + Admission Control
▶ Query Parser ▶ Query Optimizer (a.k.a., Query Planner) ▶ Query Executor
▶ Lock Manager ▶ Access Methods (a.k.a., Indexes) ▶ Buffer Pool Manager ▶ Log Manager
▶ Memory, Disk, and Networking Manager
5 / 44
Recap
6 / 44
Recap
7 / 44
Recap
8 / 44
Table Heap
9 / 44
Table Heap
Segment A: 123 3 3 Bytes 1 Byte 123 7 Record TIDs P123 567 6 TID Overflow Record P567
10 / 44
Table Heap
11 / 44
Table Heap
12 / 44
Table Heap
13 / 44
Table Heap
14 / 44
Table Heap
15 / 44
Table Heap
2.1 if S = 0, the item is at offset O, with length L 2.2 otherwise, the item was moved from another page
▶ it is also placed at offset O, with length L ▶ but the first 8 bytes contain the original TID
16 / 44
Table Heap
17 / 44
Table Heap
18 / 44
Table Heap
19 / 44
Table Heap
20 / 44
Table Heap
21 / 44
Table Heap
22 / 44
Table Heap
23 / 44
Table Heap
24 / 44
Table Heap
25 / 44
Table Heap
26 / 44
Table Heap
27 / 44
Table Heap
28 / 44
Table Heap
hash length (page/#) (page/#)chain
13 14 15 90 91
29 / 44
Table Heap
30 / 44
Table Heap
page 1 page 2
page 3 page 4
page 5 page 6
page x page x+1 byte 1 byte 2 byte 3 byte x/2
31 / 44
Table Heap
2bits
32 / 44
Table Heap
33 / 44
Table Heap
34 / 44
Table Heap
35 / 44
Table Heap
36 / 44
B-Tree Index
37 / 44
B-Tree Index
38 / 44
B-Tree Index
B-Tree with k = 2, h = 3 K47 K25 K36 K02 K03 K16 K41 K43 K26 K29 K35 K51 K53 K55 K58 K78 K86 K67 K88 K91 K95
39 / 44
B-Tree Index
B+-Tree with k = 2, h = 3 K49 K25 K35 K02 K03 K16 K36 K41 K26 K29 K35 K51 K53 K55 K58 K67 K78 K58 K90 K91 K95 K25 K43 K47 K86 K88
40 / 44
B-Tree Index
41 / 44
Hash Index
42 / 44
Hash Index
43 / 44
Hash Index
44 / 44
Hash Index