Lec1(indexing-hashin - Database System Concepts 6 th Ed ©Silberschatz Korth and Sudarshan See www.db-book.com for conditions on re-use Chapter 11

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Database System Concepts, 6 th Ed . ©Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing ©Silberschatz, Korth and Sudarshan 11.2 Database System Concepts - 6 th Edition Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing ■ Basic Concepts ■ Ordered Indices ■ B +-Tree Index Files ■ Static Hashing ■ Dynamic Hashing ■ Ordered Indexing versus Hashing ■ Index Definition in SQL ©Silberschatz, Korth and Sudarshan 11.3 Database System Concepts - 6 th Edition A Few Questions A Few Questions ■ Do you know that time to access some data in disk >> time to access some data in main memory? ■ Do you know that in accessing some data in disk, the whole disk block containing the required data has to be brought from disk into main memory? ● Disk block read requires about 5 to 10 milliseconds, versus about 100 nanoseconds for memory access ■ If you want to access some data in a database, is it a good idea to read every record in the database to search for the desired data? ● What if the database is so small that it can be stored in main memory? ● What if the database is so large that it must be stored in disk? ■ If the records are sorted in the database, do you know any good searching algorithms to reduce the search time? (binary search) ● If the database occupies 1,000,000 blocks, how many blocks have to be read by using binary search for the desired data? ( log 2 (1,000,000) =20) ● How much time it takes, if a block read takes 10 ms? (0.2 sec, is it a long time to you?) ©Silberschatz, Korth and Sudarshan 11.4 Database System Concepts - 6 th Edition Basic Concepts Basic Concepts ■ It is inefficient to read every record in a (large) database to search for desired data. ■ Indexing mechanisms used to speed up access to desired data. ● E.g., author catalog in library ■ Search Key- attribute or 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 ©Silberschatz, Korth and Sudarshan 11.5 Database System Concepts - 6 th Edition Index Evaluation Metrics Index Evaluation Metrics NO one technique is the best. ■ Access types supported efficiently ● records with a specified value in the attribute ● records with an attribute value falling in a specified range of values. ■ Access time ● time to find a data item ■ Insertion time ● time to find the correct insertion point ● time to update the index structure ■ Deletion time ● time to find the item to be deleted ● time to update the index structure ■ Space overhead occupied by the index structure ©Silberschatz, Korth and Sudarshan...
View Full Document

This note was uploaded on 01/11/2012 for the course CS CS4482 taught by Professor Drlee during the Winter '11 term at City University of Hong Kong.

Page1 / 60

Lec1(indexing-hashin - Database System Concepts 6 th Ed ©Silberschatz Korth and Sudarshan See www.db-book.com for conditions on re-use Chapter 11

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

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