Download presentation
Presentation is loading. Please wait.
Published byDwight Ball Modified over 9 years ago
1
INLS 623 Indexing examples BMH/SWH Example 1. Non-Dense (Primary) Index, “ONE FREE” matches file ordering Index 111 121 1113 235 121 2311 266 333 4343 Records 111 121 1112 111 131 2143 121 234 4544 121 349 6341 … 235 121 2311 235 122 4993 … 266 333 4343 … block Search for 235 122 4993
2
INLS 623 Indexing examples BMH/SWH Example 2. (Clustered) Non-Dense Index (ONE FREE—matches file ordering) Index Records Blue Green Grey Red Yellow Blue2 Blue3 Blue9 Green1 Green2 Green6 Grey1 Red1 Red9 Red10 Yellow6 block
3
INLS 623 Indexing examples BMH/SWH Example 3. Secondary (Dense) Index 1 entry per record Index Records Blue Green Yellow 12Blue 14Yellow 15Green 17Yellow 19Blue 23Yellow 29Green 33Green 43Blue
4
INLS 623 Indexing examples BMH/SWH Example 4. Secondary (Dense) Index 1 entry per value, all addresses Index Records Blue Green Yellow 12Blue 14Yellow 15Green 17Yellow 19Blue 23Yellow 29Green 33Green 43Blue
5
INLS 623 Indexing examples BMH/SWH Example 5. Secondary (Dense) Index 1 entry per value, address to addresses Index Records Blue Green Yellow 12Blue 14Yellow 15Green 17Yellow 19Blue 23Yellow 29Green 33Green 43Blue Addresses
6
INLS 623 Indexing examples BMH/SWH Example 6. Multilevel Index First LevelSecond LevelRecords 1 3 4 15 23 24 25 … 39 42 … 52 53 … 1 15 25 39 52 1 25 52
7
INLS 623 Indexing examples BMH/SWH Example 7a. B+ Tree Node Structure p1 v1 p2 v2 p3 v3 p4 v4 p5 Node 1Node 2Node 3Node 4Node 5
8
INLS 623 Indexing examples BMH/SWH Example 7b. B+ Tree Node Structure p1 15 p2 30 p3 50 p4 93 p5 1 12 15 16 21 24 30 31 33 47 50 51 56 78 81 93 94 99 103 …
9
INLS 623 Indexing examples BMH/SWH Hashing Function(value) = location (i.e. bin) Example: Mod 13 of (SSN) = 123-45-6789 mod 13 = 1 234-56-7899 mod 13 = 7 864-93-5196 mod 13 = 8 963-77-5936 mod 13 = 6 058-32-9744 mod 13 = 5 532-87-1523 mod 13 = 2 274-98-6648 mod 13 = 1
10
INLS 623 Indexing examples BMH/SWH Bin 1 –123-45-6789 mod 13 = 1 –274-98-6648 mod 13 = 1 Bin 2 –532-87-1523 mod 13 = 2 Bin 3 Bin 4 Bin 5 –058-32-9744 mod 13 = 5 Bin 6 –963-77-5936 mod 13 = 6 Bin 7 –234-56-7899 mod 13 = 7 Bin 8 –864-93-5196 mod 13 = 8 …. (plus overflow Bin)
11
Indexing Organization Options INLS 623 Indexing examples BMH/SWH File (on Disk)Index in RAM Unordered OrderedNo Index OrderedOne Free Primary Non-Dense Index (B+Tree) and possibly Multiple (costly) Secondary Dense Indexes (B+Tree) HashNo physical index
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.