T. Andrew Yang

Tel.: (281) 283-3835
Last updated: 11/04

CSCI 5333 Data Base Management System

Spring 2002 (1/14-5/6)

Chapter 6: Index Structures


14.1 Types of Single-Level Ordered Indexes
  • Compare: primary index, clustering index, secondary index (See Table 14.1, and Table 14.2)

14.2 Multilevel Indexes

  • Example: Indexed sequential file, ISAM (See Fig. 14.6)
  • Exercise: Examine Figure 14.6.  If the search key is 36, how many disk retrieval operations are needed to find the block?  How if the search key is inexistent in the file?
  • Question: Review question 14.4.
14.3 Dynamic Multilevel Indexes Using B-Trees and B+-Trees
  • 14.3.1 Search Trees and B-Trees
    • Search Trees: See Figure 14.8, and Figure 14.9.
search tree constraints
    • Question: How is a search tree used as a mechanism for searching for a record in a file or disk blocks containing the record?
    • Balanced search tree: All of its leaf nodes are at the same level.
    • Problems with search trees:
  1. The inserting and deleting algorithms do not guarantee the search tree is balanced.
  2. Record deletion may leave some nodes in the tree nearly empty, thus wasting storage space and increasing the number of levels.
      • Question: What's wrong with increased number of levels?
  • B-Trees
      • With the addition of data pointers, a B-tree has additional constraints that ensure that the tree is always balanced and that the space wasted by deletion, if any, never becomes excessive.
      • Question: What's the purpose of data pointers?
        • See Figure 14.10.
features 5,6,7
      • Insertion: possible propagation of node splitting (up) and increase of tree levels
      • Deletion: possible propagation of node combining, and reduction of tree levels
      • Exercises: Example 4 and 5.

  • B+-Trees
    • Data pointers are stored only at the leaf nodes of the tree; hence, the structure of leaf nodes differs from the structure of internal nodes.
    • See Figure 14.11.
internal nodes
leaf nodes
    • The pointers in internal nodes are tree pointers to blocks that are tree nodes, whereas the pointers in leaf nodes are data pointers to the data file records or blocks—except for the Pnext pointer, which is a tree pointer to the next leaf node.
    • Question: How is ordered access provided in B+-trees?
    • See example 6 and 7.
    • Algorithm 14.2: Searching algorithm.
    • Algorithm 14.3: Insertion (Also see Fig. 14.12.)
    • Deletion example: Fig. 14.13
    • Compare B-trees and B+-trees

14.4 Indexes on Multiple Keys

  • 14.4.3 Grid Files

 


Go to the Index

dd   Main Page

dd   Biography

dd   Teaching

dd    Research

dd    Services

dd     Other Links