Hi chegg! I need help on my ride. Plz show ur work 5. (20 pts) Average ANALYSIS
ID: 3606547 • Letter: H
Question
Hi chegg! I need help on my ride. Plz show ur work
5. (20 pts) Average ANALYSIS Consider a Search with Equality Selection. F or each of the Heap, Sorted, Unclustered B Tree Index File, and Unclustered Hash Index File Organizations, what is the if exactly one Data Record qualifies i.e., the Search is on a candidate key? Assume B Pages, D cost per Page, R Data Records per Page, C cost per Da Record when the Page is in memory, B. Tree Index 67% occupancy (thus number of Pages is 1.5B), H cost for hash (assume no overflow Pages), Index 80% occupancy (thus the number of Pages is 1.258). Data Entries 10% the size of Data Records. File Organ i zation Heap Sor ted Unclustered BTree Index Search cost Unc lustered Hash Index YOU NEED TO JUSTIFY YOUR ANSWER in WRITING! NSWER:Explanation / Answer
LET'S assume a system where :
Where P:no. of pages in the file.
D:amount of time required to read or write in page.
R:no. of records in a particular page.
1. Heap Files
Equality Search: If exactly one record matches the desired equality search then on average we must scan half of the file, assuming record exists in only that part of file. Hence cost is 0.5 PD
So,Heap = 0.5*B*D =.0.5BD
2. Sorted Files
Equality Search: If we assume that the equality search is specified on the field by which the file is sorted, then we can search for the record by the help of binary search. Hence cost is Dlog2(P)
3.Unclustered Tree Index
Equality Search: If we assume that data index size is one-tenth of data record, then no. leaf pages are 0.15P. So cost incurred is D + DlogF(0.15P).
4.Unclustered Hash Index
Equality Search: If search is on the search key of hashed file, then total cost is of only getting the relevant page of data entry and record, so cost is 2D.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.