{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec1(indexing-hashing) - Chapter 11 Indexing and Hashing...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
©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
Image of page 2
©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?)
Image of page 3

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

View Full Document Right Arrow Icon
©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
Image of page 4
©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
Image of page 5

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

View Full Document Right Arrow Icon
©Silberschatz, Korth and Sudarshan 11.6 Database System Concepts - 6 th Edition Ordered Indices Ordered Indices
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern