week6 - (week 5 continued) Addition: Additions are made to...

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

View Full Document Right Arrow Icon
(week 5 continued) Addition: Additions are made to the end of the file. end of file prime area Deletion: 1. Only one record associated with the prime data area. Mark the position of record x as available. 2. Deletion of A from the following file 3. Deletion of B from the following file
Background image of page 1

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

View Full DocumentRight Arrow Icon
Top-module for deletion: open input trans-file open I-o master file move oto end-of-trans-file perform apply-transaction until end-of-trans-file = 1 close file stop run Apply – transaction A – perform addition operation D – perform delete operation M – perform modification operation perform read-trans-file
Background image of page 2
Delete operation Move T k to input-of-hash-function Perform hash-function Perform output-of-has-functionto record-position Perform check-existence Case of record-states : notfound: error :found: perform take-out-record end-of-case Hashing Techniques For Extendable Hashing Files expand and shrink as we add and delete records. B + trees index data nodes
Background image of page 3

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

View Full DocumentRight Arrow Icon
index data nodes (buckets) Extendible File B + trees 90 o H(K) = pseudo key index (binary number) data bucket We have: 2 disk accesses : index, data bucket 1 disk access : keep index in main memory only one disk access and it is for the data bucket number of index entries index depth 2 1 4 2
Background image of page 4
8 3 16 4 n log 2 n Use the leftmost (most significant) n bits (n = depth of index) of the pseudo key to select the corresponding index entry. directory depth (d) bucket depth (p): number of bits needed to distinguish the pseudo key on a page from those on other pages. Example for Extendible Hashing: Insert 46: Insert 70:
Background image of page 5

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

View Full DocumentRight Arrow Icon
Insert 7: Insert 61:
Background image of page 6
Example: Directory Size n=6000000(400 bytes/record) Bkfr=50(Bucket size= 50*400=20kb) Lf=0.7 6000000/(50*0.7)=171429 buckets (<218) No of pointers =218 4 bytes/ pointer 218*22=220=(1 MB)
Background image of page 7

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

View Full DocumentRight Arrow Icon
A variation: Bounded Index Extendible Hashing (By Lomet) Larger Buckets Index has multiple levels The forest of binary trees is used in dynamic hashing
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 / 21

week6 - (week 5 continued) Addition: Additions are made to...

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