assignment 4 - r = 60,000 Bfr = [B/R] = [1024/50] = 20...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 4 B: block size, R: record size, r: total number of records. b: number of blocks a file has. Given B=1024, R=50, r=60,000. The record is ordered by Item_ID. We use primary index, where the ordering key field is 7 bytes and a block pointer is 8 bytes. Use the primary index to facilitate the search of an Item_ID. What is the number of blocks needed to load to the main memory in order to search a Item_ID? b Given : R = 50 B = 1024
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r = 60,000 Bfr = [B/R] = [1024/50] = 20 records per block. Number of blocks needed = [r/bfr] = 60000 / 20 = 3000 blocks V = 7 bytes P = 8 bytes Ri = V+P = 7+8 = 15 bytes. B/Ri = [1024/15] = 68 entries per block. Number of index blocks is bi = (ri/bfri) = [3000 / 68] = 45 blocks To perform binary search on index file would need [(log 2 bi)] = [(log 2 45)] = 6 blocks To search for record using index 6 + 1 = 7 blocks are needed....
View Full Document

Ask a homework question - tutors are online