Question

Assume a relation is structured with a sequential file organization and has fixed length records. Also...

Assume a relation is structured with a sequential file organization and has fixed length records. Also assume that after processing, the relation is fully "sequentially ordered" and that no subsequent changes have been made. Assume a disk block has 10240 bytes, a record is 1000 bytes, and an index is 16 bytes. The indices are "sparse" and at the bottom level, point to the first record of the pertinent disk block. How many disk blocks are needed to account for the records and indices? Show all work and note any assumptions.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let us assume that there are a total of N records.

Firstly, number of records that can be stored in a block

= floor ( (Size of 1 block in bytes) / (Size of 1 record in bytes) )

= floor ( 10240 / 1000 )

= 10

Thus, number of blocks required to store all N records

= ceiling ( (Number of records) / (Number of records per block) )

= ceiling ( N / 10 )

= \color{green}\left \lceil \frac{N}{10} \right \rceil

Secondly, number of index-entries that can be stored in a block

= floor ( (Size of 1 block in bytes) / (Size of 1 index-entry in bytes) )

= floor ( 10240 / 16 )

= 640

Now, in a sparse index, there is one index-entry for each data-block.

Thus, number of blocks required to store all index-entries

= ceiling ( (Number of index-entries) / (Number of index-entries per block) )

= ceiling ( (Number of data-blocks) / (Number of index-entries per block) )

=\color{green}\left \lceil \frac{\left \lceil \frac{N}{10} \right \rceil}{640} \right \rceil

In summary, for a total of N records,

  • Number of data-blocks required
    • = \color{green}\left \lceil \frac{N}{10} \right \rceil
  • Number of index-blocks required
    • =\color{green}\left \lceil \frac{\left \lceil \frac{N}{10} \right \rceil}{640} \right \rceil
  • Total number of blocks required
    • =\color{green}\left \lceil \frac{N}{10} \right \rceil + \left \lceil \frac{\left \lceil \frac{N}{10} \right \rceil}{640} \right \rceil
Add a comment
Know the answer?
Add Answer to:
Assume a relation is structured with a sequential file organization and has fixed length records. Also...
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
  • 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...

  • 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...

  • 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...

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