Indexing1 - Index Structures for Files Tools: File...

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

View Full Document Right Arrow Icon
Index Structures for Files Tools: File organization Index Structures File already exists with some organization Unordered Ordered Hash Indexing: Additional Access Structures Speedup retrieval Search on indexing fields
Background image of page 1

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

View Full DocumentRight Arrow Icon
Index Structures for Files Single-level Ordered Indexes Primary Indexes Clustering Indexes Secondary Indexes Multilevel Indexes Dynamic Multilevel Indexes B-Trees, B+-Trees Indexes on Multiple Keys
Background image of page 2
Single-level Ordered Index Example: Book index Usually on a single field of a file Index stores: Each value of index field Pointers to disk blocks (pages in a book) containing records with that field value Index is small binary search Primary, clustering, secondary indices
Background image of page 3

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

View Full DocumentRight Arrow Icon
Single-level Ordered Index Primary index is on ordering key field If ordering field is not key (repetitions) clustering index At most one primary index, or one clustering index; but not both. Why? Secondary indices: Non-ordering field Can have several
Background image of page 4
Primary Index Index Entries: One for each block Two fields Primary key for the first record in a block (block anchor) Pointer to that block
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Primary Index What is the total number entries in the index? Number of blocks Index entries for some Sparse index Dense index: Index entry for every search key value What is the major problem in a primary index? Insertion, deletion (as usual!!) Solutions: Leave some unused space Unordered overflow file (batch inserts) Deletion markers Link list of overflow records (as in hashing)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Clustering Index File records are physically ordered on a nonkey field clustering field
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 39

Indexing1 - Index Structures for Files Tools: File...

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

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