ch12-2 - Chapter 12: Indexing and Hashing ! Basic Concepts...

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

View Full Document Right Arrow Icon
1 ©Silberschatz, Korth and Sudarshan 12.1 Database System Concepts 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 ©Silberschatz, Korth and Sudarshan 12.2 Database System Concepts Basic Concepts 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 ©Silberschatz, Korth and Sudarshan 12.3 Database System Concepts Index Evaluation Metrics 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 ©Silberschatz, Korth and Sudarshan 12.4 Database System Concepts Ordered Indices 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. Indexing techniques evaluated on basis of:
Background image of page 2
3 ©Silberschatz, Korth and Sudarshan 12.5 Database System Concepts Dense Index Files Dense Index Files ! Dense index — Index record appears for every search-key value in the file. ©Silberschatz, Korth and Sudarshan 12.6 Database System Concepts Sparse Index Files 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 ! Less space and less maintenance overhead for insertions and deletions. ! Generally slower than dense index for locating records.
Background image of page 3

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

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

Page1 / 38

ch12-2 - Chapter 12: Indexing and Hashing ! Basic Concepts...

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

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