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

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 searchkey 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
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 11 Storage and File Structure.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 10 XML.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 1 Introduction(Avi Silberschatz Henry F. Korth S. Sudarshan).ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,附录,英文版)Appendix C Advanced Relational Database Design.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,附录,英文版)Chapter B Hierarchical Model.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,附录,英文版)Chapter A Network Model.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,附录,英文版)Hierarchical Model.pdf
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,附录,英文版)Network Model.pdf
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,附录,英文版)Other Relational Query Languages.pdf
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,附录,英文版)Advanced Relational Database Design.pdf
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 9 Application Design and Development.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 8 Relational Database Design.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 7 Database Design - The Entity-Relationship Approach.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 6 Formal Relational Query Languages.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 5 Advanced SQL.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 4 Intermediate SQL.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 3 Introduction to SQL.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 26 Advanced Transaction Processing.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 25 Advanced Data Types and New Applications.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第六版,PPT课件讲稿,英文版)Chapter 24 Advanced Application Development.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 13 Query Processing.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 14 Query Optimization.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 15 Transactions.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 16 Concurrency Control.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 17 Recovery System.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 18 Data Analysis and Mining.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 19 Information Retrieval.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 2 Relational Model.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 20 Database System Architectures.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 21 Parallel Databases.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 22 Distributed Databases.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 23 Advanced Application Development.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 24 Advanced Data Types.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter Advanced Transaction Processing.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 3 SQL.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 4 Advanced SQL.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 5 Other Relational Languages.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 6 Entity-Relationship Model.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 7 Relational Database Design.ppt
- 《数据库系统概念 Database System Concepts》原书教学资源(第五版,PPT课件讲稿,英文版)Chapter 8 Application Design and Development.ppt