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 each leaf level page is 70% filled, how many leaf level pages are needed? 5) What’s the size of one index entry? 6) What is the height of the B+ tree (suppose each index level page is also 70% filled)? 7) Given a query: find all records with 100
Solution
1)
Incase if it is 100 percent utilisation
Pages in the file will be
=106/(1000/100)
=106/10
=105
So the answer is
105 pages
--
2)
1 data entry per record
Please note that by default we use alternative two for a data entry
106
3)
8 bytes
Because search key value and pid
4)
Each leaf level page is 70% filled
So we need to assume 70% utilisation for the page
---
5)
Index entry is the search key value and pid
=search key value+pid
=8 bytes
---
6)
The index entry is the same size as the data entry
Therefore
The fanout of an index page is
[(1000/8)*0.7]+1
=88
“+1” is the left most pointer in an index page
The index page is 11429 pages in the leaf level
Therefore
The height of the tree
[log88 11429]
=3(without counting the root level or leaf level)
With the root level or leaf level
The height of the tree is
=4
---
all the best
Page size is 1K bytes, and the avg record size is 100 bytes. Given 1 million...
6) Paging [26 pts] Suppose you have a computer system with a 38-bit logical address, page size of 16K, and 4 bytes per page table entry a) How many pages are there in the logical address space? Suppose we use two level paging and each page table can fit completely in a frame. [4 pts] How many pages? [2 pts] Show your calculations here: b) For the above-mentioned system, give the breakup of logical address bits clearly indicating number of...
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, with 10 bytes for the key: i) How many records will be stored in each leaf node? i In any index node? i) For the M-ary tree, what is the value of M? c) Assume a block size of 4096 bytes; one node per block; disk references of 8 bytes each; and a record size...
You have a processor that supports virtual memory. The page size used for the virtual memory is 16 KiBytes, The virtual address size is 24 bits. Each table entry is 2 bytes. How many pages will the processor support? ___ How big is the page table (assume a single level page table) ___
1. Consider a simple paging system with the following parameters: 232 bytes of physical memory; page size of 210 bytes; 216 pages of logical address space. How many bits are in a logical address? How many bytes are in a frame! How many bits in the physical address specify the frame? How many entries are in the page table? How many bits are in each page table entry? Assume each page table entry contains a valid/invalid bit. 2. Consider a...
A computer system has a 36-bit virtual address space with a page size of 8K, and 4 bytes per page table entry. How many pages are in the virtual address space? What is the maximum size of addressable physical memory in this system? If the average process size is 8GB, would you use a one-level, two-level, or three-level page table? Why? Compute the average size of a page table in part c above
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...
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...
Exercise l: Suppose that we have a virtual memory space of 28 bytes for a given process and physical memory of 4 page frames. There is no cache. Suppose that pages are 32 bytes in length. 1) How many bits the virtual address contain? How many bits the physical address contain? bs Suppose now that some pages from the process have been brought into main memory as shown in the following figure: Virtual memory Physical memory Page table Frame #...
A computer has 32-bit virtual addresses and the page size is 2^3 KB. Suppose the text, data, and stack segments of a process need 5 page(s) each. If the computer uses two-level page tables, with 3 bits for the second-level index, how many page table entries (PTEs) are in each second-level page table?
Q1. Suppose we have a virtual memory of size 2 Terabytes (2048GB, or 241 bytes), where pages are 8KB (213 bytes) each, and the machine has 4GB (232 bytes) of physical memory. a) Compute the number of page table entries needed if all the pages are being used. b) Compute the size of the page table if each page table entry also required 4 additional bits (valid, protection, dirty, use). Q2. For this problem, you are given a...