Question


c) Assume a block size of 4096 bytes; one node per block; disk references of 8 bytes each; and a record size of 160 bytes, wi

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

Indices are usually implemented using B+ trees. In B+ trees, only the leaf nodes have data/records and not the internal/non-leaf nodes. Here is a diagram of an index B+ tree:

INTERNAL NODE P, Ki Ki- P Ki Ko Pe Ki,XKi LEA F NODE: Ke Pe Pnet K, D, KD P node pointer Ki key Di: data pointer Prext pointe

Now let us try to calculate the number of record references will be stored in the leaf nodes. Note that records are not stored in the nodes, just their references are stored. Now for simplicity let us assume that the disk reference is of the same size as the page reference (8 bytes). Let the number of keys in the leaf node be c.

Blocksize > C* (key diskreference)pointer

4096 c (10 8)8

4088 -227 18 C

i) Hence, 227 record references will be stored in the leaf nodes.

As we see from the image, no nodes apart from the leaf nodes store any records. Hence,

ii) No record reference will be stored in other index nodes.

Let us try to find the maximum pointers that can be stored in the internal nodes similar to the first part. Let's say there are c pointers, therefore according to the image, there will be c-1 keys.

Blocksizec * pointer(c- 1)* key

4096 c 8(c- 1) * 10

4106 18c

4106 228 C 18

Hence, there are 228 pointers in each non-leaf node which is what M denotes in an M-ary tree.

iii) M = 228

Note that in real world implementations, the disk references and page pointers are of different sizes. Also there are more things stored in the nodes for practical purposes. Therefore, these numbers are only indicative and not exact!

Feel free to ask any doubts and I'll be happy to help!

Add a comment
Know the answer?
Add Answer to:
c) Assume a block size of 4096 bytes; one node per block; disk references of 8...
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...

  • Consider a disk with a sector size of 512 bytes, 2000 tracks per surface, 50 sectors...

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

  • Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk...

    Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk is formatted blocks 0 is occupied for system-related information. The system always allocated free blocks starting st the lowest numbered block, and it uses non-contiguous allocation. Question 6 (2, 4) Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk is formatted blocks 0 is occupied for system-related information. The system always allocates free blocks starting at the...

  • Page size is 1K bytes, and the avg record size is 100 bytes. Given 1 million...

    Page size is 1K bytes, and the avg record size is 100 bytes. Given 1 million records in a table, answering the following questions. 1) Suppose the table is stored in a heapfile, how many pages are in this file? 2) We will build an unclustered index B+ tree on this table over attribute A, how many data entries are contained in the leaf level? 3) Suppose A is integer type, what’s the size of a data entry? 4) Suppose...

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

  • Part B Consider a file system that uses a structure similar to an i-node with the...

    Part B Consider a file system that uses a structure similar to an i-node with the following differences. If the file size is less than 100 bytes, the data is stored directly in the i-node. If it is larger, there are 8 direct links (point to a data block), 2 single-indirect links, 1-double indirect links and 1 triple indirect link. What is the largest file size that can be indexed in this system? Assume the block size is 1024 bytes....

  • Assume that you have built a dense B+-tree index on SSN, and the B+-tree's leaf nodes...

    Assume that you have built a dense B+-tree index on SSN, and the B+-tree's leaf nodes contain record ids pointing to data records in data file. Assume 10-byte long. Assume also that you built the tree by using bulk loading so that the nodes at each level were filled up as much as possible. 4. a. b. How many levels does the resulting tree have? For each level of the tree, how many nodes are at that level? How many...

  • 11. [6] We are going to design our B+ Tree to be as optimal as possible...

    11. [6] We are going to design our B+ Tree to be as optimal as possible for our old hard drives (since the management won't buy new ones, those cheapskates! We want to keep the tree as short as we can, and pack each disk block in the filesystem as tightly as possible. We also want to access our data in sorted order for printing out reports, so each leaf node will have a pointer to the next one. see...

  • Question 12 Consider a magnetic disk drive with 10 double sided platters, 512(=2^9) tracks per surface,...

    Question 12 Consider a magnetic disk drive with 10 double sided platters, 512(=2^9) tracks per surface, and 1024 (=2^10) sectors per track. Sector size is 2KBytes (=2^10 Bytes ). Assume the average seek time 0.02 ms, the seek time from a track to its adjacent track can be ignored. The drive rotates at 5400 rpm. Successive tracks in a cylinder can be read without head movement. Furthermore, disks can be handled independently, so multiple tracks in a cylinder can be...

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