Btree - B -Tree Index Files o Structure of a B -Tree o...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
B -Tree Index Files o Structure of a B -Tree o Queries on B -Trees o Updates on B -Trees o B -Tree File Organization B-Tree Index Files Static Hashing o Hash File Organization Hash Functions Handling of bucket overflows o Hash Indices Dynamic Hashing Comparison of Indexing and Hashing Index Definition in SQL Multiple-Key Access o Grid File o Partitioned Hashing B -Tree Index Files 1. Primary disadvantage of index-sequential file organization is that performance degrades as the file grows. This can be remedied by costly re-organizations. 2. B -tree file structure maintains its efficiency despite frequent insertions and deletions. It imposes some acceptable update and space overheads. 3. A B -tree index is a balanced tree in which every path from the root to a leaf is of the same length. 4. Each nonleaf node in the tree must have between and n children, where n is fixed for a particular tree. Structure of a B -Tree Queries on B -Trees Updates on B -Trees B -Tree File Organization Structure of a B -Tree 1. A B -tree index is a multilevel index but is structured differently from that of multi-level index sequential files. 2. A typical node (Figure 11.6 ) contains up to n -1 search key values , and n pointers . Search key values in a node are kept in sorted order.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Figure 11.6: Typical node of a B+-tree. 3. For leaf nodes, ( ) points to either a file record with search key value , or a bucket of pointers to records with that search key value. Bucket structure is used if search key is not a primary key, and file is not sorted in search key order. Pointer ( n th pointer in the leaf node) is used to chain leaf nodes together in linear order (search key order). This allows efficient sequential processing of the file. The range of values in each leaf do not overlap. 4. Non-leaf nodes form a multilevel index on leaf nodes. A non-leaf node may hold up to n pointers and must hold pointers. The number of pointers in a node is called the fan-out of the node. Consider a node containing m pointers. Pointer ( ) points to a subtree containing search key values and . Pointer points to a subtree containing search key values . Pointer points to a subtree containing search key values . 5. Figures 11.7 (textbook Fig. 11.8) and textbook Fig. 11.9 show B -trees for the deposit file with n =3 and n =5. Figure 11.7: B+-tree for deposit file with n = 3. Queries on B -Trees 1. Suppose we want to find all records with a search key value of k . o Examine the root node and find the smallest search key value . o Follow pointer to another node.
Background image of page 2
o If follow pointer . o Otherwise, find the appropriate pointer to follow. o Continue down through non-leaf nodes, looking for smallest search key value > k and following the corresponding pointer. o
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

Btree - B -Tree Index Files o Structure of a B -Tree o...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online