Question

Assume a sorted relation has 40 GB (file size), block size is 4KB, each block stores 40 records. ...

Assume a sorted relation has 40 GB (file size), block size is 4KB, each block stores 40 records. Assume the index B+ tree has entries for each record, and the fanout of the node for B+ tree is 100. Select with an equality condition on the attribute, search key of index. Assume the disk seek cost is 5 milliseconds, and block transfer cost is 1 milliseconds. Also assume if the selection is a non key attribute, there are 100 matching records (duplicates).

For the following selection operations, consider which selection algorithm applies for each case, and find the number of block transfers, the number of seeks, and the cost, respectively:
1. Suppose that B+ tree index search key is the attribute used to sort the relation, and is also a key attribute.
2. Suppose that the index search key is not the attribute used to sort the relation, but is a key attribute. Analyze its difference from 1.
3. Suppose that the index search key is the attribute used to sort the relation, but is a nonkey attribute. Analyze its difference from 1.
4. Suppose that the index search key is not the attribute used to sort the relation, and is a nonkey attribute. Analyze its difference from 1.
5. How about using linear search? Analyze the selection on key or non-key attribute, respectively.
0 0
Add a comment Improve this question Transcribed image text
Answer #1
Size of 1 record = 8 + 4 = 12

Let the order be N.

No. of index values per block = N - 1

(N - 1) 12 + 4 = 512

12N - 12 + 4 = 512

16N = 1009

N = 43.33
Add a comment
Know the answer?
Add Answer to:
Assume a sorted relation has 40 GB (file size), block size is 4KB, each block stores 40 records. ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose you need to sort a relation of 40 gigabytes, with 4-kilobyte blocks, using a memory...

    Suppose you need to sort a relation of 40 gigabytes, with 4-kilobyte blocks, using a memory size of 40 megabytes. Suppose the cost of a seek is 5 milliseconds, while the disk transfer rate is 40 megabytes per second. Assume bb = 1. What is the total time in seconds to sort the relation? Now, assume a flash storage device is used instead of a disk, and it has a latency of 20 microsecond and a transfer rate of 400...

  • Consider a disk with block size = 4096 bytes. A block pointer is 6 bytes and...

    Consider a disk with block size = 4096 bytes. A block pointer is 6 bytes and a record pointer is 8 bytes long. A file has 100,000 records of fixed length. Each record has the following fields and byte size: Name (30), Ssn (9), Dept (9), Address (40), Phone (10), Bdate (8), Sex (1), Job (4) and Salary (4). An additional byte is used as a deletion marked. a. Calculate the record size R in bytes b. Calculate the blocking...

  • Problem 1. Consider a disk with block size B=1024 bytes. A block pointer is P =...

    Problem 1. Consider a disk with block size B=1024 bytes. A block pointer is P = 8 bytes long, and a record pointer is R =7 bytes long. A file has r=5,000,000 EMPLOYEE records of fixed- length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), DEPARTMENTCODE (9 bytes), ADDRESS (35 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), JOBCODE (4 bytes), SALARY (4 bytes, real number). An additional byte is used as a deletion...

  • ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate)...

    ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate) Employees(EmpID, FirstName, LastName, JobTitle) ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) The CRID is the primary key, it is unique, and it is an positive integer The CRType may be one of two values: "Deficiency" or "Enhancement" CRTitle is a variable length string that may be up to 2048 characters CROriginDate is a date CRPriority is an integer that may assume a value of...

  • Chapter overview 1. Reasons for international trade Resources reasons Economic reasons Other reasons 2. Difference between...

    Chapter overview 1. Reasons for international trade Resources reasons Economic reasons Other reasons 2. Difference between international trade and domestic trade More complex context More difficult and risky Higher management skills required 3. Basic concept s relating to international trade Visible trade & invisible trade Favorable trade & unfavorable trade General trade system & special trade system Volume of international trade & quantum of international trade Commodity composition of international trade Geographical composition of international trade Degree / ratio of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT