4 Chapter17 Index
4 Chapter17 Index
4 Chapter17 Index
Navathe
CHAPTER 17
Figure 17.1 Primary index on the ordering key field of the file shown in Figure 16.7
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 17-7
Primary Indexes (cont’d.)
◼ Major problem: insertion and deletion of records
◼ Move records around and change index values
◼ Solutions
◼ Use unordered overflow file
◼ Use linked list of overflow records
Table 17.1 Types of indexes based on the properties of the indexing field
Suppose we want to search for a record with a specific value with an index. The
index value V = 9 bytes long. Suppose a block pointer is P = 6 bytes.
E- How many index entries per block?
G. How many blocks will be accessed using the dense secondary index?
Figure 17.10 B-tree structures (a) A node in a B-tree with q−1 search values (b) A
B-tree of order p=3. The values were inserted in the order 8, 5, 1, 7, 3, 12, 9, 6
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 17-24
Demo
https://www.cs.usfca.edu/~galles/visualization/BTree.html
Figure 17.11 The nodes of a B+-tree (a) Internal node of a B+-tree with q−1 search
values (b) Leaf node of a B+-tree with q−1 search values and q−1 data pointers
Algorithm 17.2 Searching for a record with search key field value K, using a B+ -Tree