Session12

Session12 - Chapter 12: Indexing and Hashing (Cnt.) Basic...

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

View Full Document Right Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing ( ( Cnt Cnt .) .) x Basic Concepts x Ordered Indices x B+-Tree Index Files x B-Tree Index Files x Static Hashing x Dynamic Hashing x Comparison of Ordered Indexing and Hashing x Index Definition in SQL x Multiple-Key Access
Background image of page 1

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

View Full DocumentRight Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 2 Dynamic Hashing Dynamic Hashing x Good for database that grows and shrinks in size x Allows the hash function to be modified dynamically x Extendable hashing – one form of dynamic hashing s Hash function generates values over a large range — typically b -bit integers, with b = 32. s At any time use only a prefix of the hash function to index into a table of bucket addresses. s Let the length of the prefix be i bits, 0 i 32. s Bucket address table size = 2 i. Initially i = 0 s Value of i grows and shrinks as the size of the database grows and shrinks. s Multiple entries in the bucket address table may point to a bucket. s Thus, actual number of buckets is < 2 i • The number of buckets also changes dynamically due to coalescing and splitting of buckets.
Background image of page 2
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 3 General Extendable Hash Structure General Extendable Hash Structure In this structure, i 2 = i 3 = i , whereas i 1 = i – 1 (see next slide for details)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 4 Use of Extendable Hash Structure: Example Use of Extendable Hash Structure: Example Initial Hash structure, bucket size = 2
Background image of page 4
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 5 Example (Cont.) Example (Cont.) x Hash structure after insertion of one Brighton and two Downtown records Brighton 0010 Downtown 1010
Background image of page 5

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

View Full DocumentRight Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 6 Example (Cont.) Example (Cont.) Hash structure after insertion of Mianus record Brighton 0010 Downtown 1010 Mianus 1100
Background image of page 6
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 7 Example (Cont.) Example (Cont.) Hash structure after insertion of three Perryridge records Brighton 0010 Downtown 1010 Mianus 1100 Perryridge 1111
Background image of page 7

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

View Full DocumentRight Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 8 Example (Cont.) Example (Cont.) x Hash structure after insertion of Redwood and Round Hill records Brighton 0010 Downtown 1010 Mianus 1100 Perryridge 1111 Redwood 0011 Round 1101
Background image of page 8
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 9 Use of Extendable Hash Structure Use of Extendable Hash Structure x Each bucket j stores a value i j ; all the entries that point to the same bucket have the same values on the first i j bits. x
Background image of page 9

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

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

This document was uploaded on 05/16/2010.

Page1 / 26

Session12 - Chapter 12: Indexing and Hashing (Cnt.) Basic...

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

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