当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 12 Indexing and Hashing

资源类别:文库,文档格式:PPT,文档页数:82,文件大小:1.63MB,团购合买
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
点击下载完整版文档(PPT)

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

Sparse Index Files Sparse Index:contains index records for only some search-key values. Applicable when records are sequentially ordered on search-key To locate a record with search-key value K we: Find index record with largest search-key value K Search file sequentially starting at the record to which the index record points Brighton A-217 Brighton 750 Mianus A-101 Downtown 500 Redwood A-110 Downtown 600 A-215 Mianus 700 A-102 Perryridge 400 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.7 @Silberschatz,Korth and Sudarshan

Database System Concepts - 5 12.7 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Sparse Index Files Sparse Index: contains index records for only some search-key values. Applicable when records are sequentially ordered on search-key To locate a record with search-key value K we: Find index record with largest search-key value < K Search file sequentially starting at the record to which the index record points

Sparse Index Files (Cont.) Compared to dense indices: Less space and less maintenance overhead for insertions and deletions. Generally slower than dense index for locating records. Good tradeoff:sparse index with an index entry for every block in file, corresponding to least search-key value in the block. data block 0 data block 1 Database System Concepts-5th Edition,Oct 4,2006 12.8 ©Silberschat乜,Korth and Sudarshan

Database System Concepts - 5 12.8 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Sparse Index Files (Cont.) Compared to dense indices: Less space and less maintenance overhead for insertions and deletions. Generally slower than dense index for locating records. Good tradeoff: sparse index with an index entry for every block in file, corresponding to least search-key value in the block

Multilevel Index If primary index does not fit in memory,access becomes expensive Solution:treat primary index kept on disk as a sequential file and construct a sparse index on it. outer index-a sparse index of primary index inner index-the primary index file If even outer index is too large to fit in main memory,yet another level of index can be created,and so on. Indices at all levels must be updated on insertion or deletion from the file. Database System Concepts-5th Edition,Oct 4,2006 12.9 ©Silberschat乜,Korth and Sudarshan

Database System Concepts - 5 12.9 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Multilevel Index If primary index does not fit in memory, access becomes expensive. Solution: treat primary index kept on disk as a sequential file and construct a sparse index on it. outer index – a sparse index of primary index inner index – the primary index file If even outer index is too large to fit in main memory, yet another level of index can be created, and so on. Indices at all levels must be updated on insertion or deletion from the file

Multilevel Index (Cont.) index data block 0 block 0 index data block 1 block 1 outer index inner index Database System Concepts-5th Edition,Oct 4,2006 12.10 @Silberschatz,Korth and Sudarshan

Database System Concepts - 5 12.10 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Multilevel Index (Cont.)

Index Update:Deletion If deleted record was the only record in the file with its particular search- key value,the search-key is deleted from the index also. Single-level index deletion: Dense indices-deletion of search-key:similar to file record deletion Sparse indices- if an entry for the search key exists in the index,it is deleted by replacing the entry in the index with the next search-key value in the file (in search-key order). If the next search-key value already has an index entry,the entry is deleted instead of being replaced. Brighton A-217 Brighton 750 Mianus A-101 Downtown 500 Redwood A-110 Downtown 600 A-215 Mianus 700 A-102 Perryridge 400 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.11 ©Silberschat乜,Korth and Sudarshan

Database System Concepts - 5 12.11 ©Silberschatz, Korth and Sudarshan th Edition, Oct 4, 2006 Index Update: Deletion If deleted record was the only record in the file with its particular search￾key value, the search-key is deleted from the index also. Single-level index deletion: Dense indices – deletion of search-key:similar to file record deletion. Sparse indices –  if an entry for the search key exists in the index, it is deleted by replacing the entry in the index with the next search-key value in the file (in search-key order).  If the next search-key value already has an index entry, the entry is deleted instead of being replaced

点击下载完整版文档(PPT)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共82页,可试读20页,点击继续阅读 ↓↓
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有