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

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) )

In summary, for a total of N records,



Assume a relation is structured with a sequential file organization and has fixed length records. Also...
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 = 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 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...
Consider a disk with a sector size of 512 bytes, 2000 tracks per surface, 50 sectors per track, five double-sided platters, and average seek time of 10 msec Suppose that a block size of 1024 bytes is chosen. Suppose that a file containing 100,000 records of 100 bytes each is to be stored on such a disk and that no record is allowed to span two blocks 1. Suppose the interleaving factor is 3. What time is required to read...
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...
C++ only. PROBLEM STATEMENT: A review and extension of cs132:sort a file with 120 records. However, due to memory restrictions only 20 records may be placed into memory. You are to implement a “quasi” external sort CODE/DIRECTIONS: For the sake of simplicity, and without much loss of generality, we will say for this lab are records are just ints : thus sort a file with 120 ints where only 20 ints maybe placed into memory at any one time general...