Chapter 12:Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL Multiple-Key Access Database System Concepts-5th Edition,Oct 4,2006 12.2 @Silberschatz,Korth and Sudarshan
Database System Concepts - 5 12.2 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL Multiple-Key Access
Basic Concepts Indexing mechanisms used to speed up access to desired data. E.g.,author catalog in library Search Key -attribute to set of attributes used to look up records in a file. An index file consists of records(called index entries)of the form search-key pointer Index files are typically much smaller than the original file Two basic kinds of indices: Ordered indices:search keys are stored in sorted order Hash indices:search keys are distributed uniformly across “buckets”using a“nash function”. Database System Concepts-5th Edition,Oct 4,2006 12.3 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 12.3 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Basic Concepts Indexing mechanisms used to speed up access to desired data. E.g., author catalog in library Search Key - attribute to set of attributes used to look up records in a file. An index file consists of records (called index entries) of the form Index files are typically much smaller than the original file Two basic kinds of indices: Ordered indices: search keys are stored in sorted order Hash indices: search keys are distributed uniformly across “buckets” using a “hash function”. search-key pointer
Index Evaluation Metrics Access types supported efficiently.E.g., records with a specified value in the attribute or records with an attribute value falling in a specified range of values. Access time Insertion time Deletion time Space overhead Database System Concepts-5th Edition,Oct 4,2006 12.4 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 5 12.4 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Index Evaluation Metrics Access types supported efficiently. E.g., records with a specified value in the attribute or records with an attribute value falling in a specified range of values. Access time Insertion time Deletion time Space overhead
Ordered Indices In an ordered index,index entries are stored sorted on the search key value.E.g.,author catalog in library. Primary index:in a sequentially ordered file,the index whose search key specifies the sequential order of the file. Also called clustering index The search key of a primary index is usually but not necessarily the primary key. Secondary index:an index whose search key specifies an order different from the sequential order of the file.Also called non-clustering index. Index-sequential file:ordered sequential file with a primary index. Database System Concepts-5th Edition,Oct 4,2006 12.5 @Silberschatz,Korth and Sudarshan
Database System Concepts - 5 12.5 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Ordered Indices In an ordered index, index entries are stored sorted on the search key value. E.g., author catalog in library. Primary index: in a sequentially ordered file, the index whose search key specifies the sequential order of the file. Also called clustering index The search key of a primary index is usually but not necessarily the primary key. Secondary index: an index whose search key specifies an order different from the sequential order of the file. Also called non-clustering index. Index-sequential file: ordered sequential file with a primary index
Dense Index Files Dense index-Index record appears for every search-key value in the file. Brighton A-217 Brighton 750 Downtown A-101 Downtown 500 Mianus A-110 Downtown 600 Perryridge A-215 Mianus 700 Redwood A-102 Perryridge 400 Round Hill A-201 Perryridge 900 A-218 Perryridge 700 A-222 Redwood 700 A-305 Round Hill 350 Database System Concepts-5th Edition,Oct 4,2006 12.6 @Silberschatz,Korth and Sudarshan
Database System Concepts - 5 12.6 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Dense Index Files Dense index — Index record appears for every search-key value in the file