






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Database Systems; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2004;
Typology: Assignments
1 / 10
This page cannot be seen from the preview
Don't miss anything!







Problem 1 (Storage, 30 points)
Consider a disk with a sector size of 512 bytes, 2000 tracks per surface, 50 sectors per track, 5 double-sided platters, average seek time of 10 msecs.
Suppose that a block size of 1024 is chosen. Suppose that a file containing 100, records of 100 bytes is to be stored on such a disk and that no record is allowed to span two blocks.
Answer:
a) Problem 3 (B+ Tree, 20 points 4 points for each sub part)
Fig. 1
Fig. 1 denotes a B+ tree which stores actual data items in the leaf nodes and has only one pointer per page. Each intermediate node can hold up to five pointers and four key values. Each leaf can hold up to four records. For this tree answer the following questions
a) Name all the nodes that would be fetched to answer the following query: “Get all records with search keys greater than 38.” b) Show the B+ tree that would result from inserting a record with search key 109 into the tree. c) Show the B+ tree that would result from deleting the record with search key 81 from the original tree. d) Name a search key value such that inserting it into the original tree would cause its height to increase. e) Note that sub-trees A, B, C are not fully specified. Nonetheless, what can you infer about the contents and the shape of this tree.
Answer:
a) I1, I2, [L2 … L8].
b)
Fig. 2 c)
d) Any search key within the range [50 … 79] would suffice. The entry into the leaves would cause the leaf to split and would increase the number of leaf nodes. To add extra pointers the internal node I2 would need to split. To accommodate this split the root would have to split increasing the height of the tree. e) The various things that can be inferred are: a. They all must have height 1, because their siblings have height 1. b. Sub-tree A holds keys less than 10, sub-tree B has keys ≥ 10 and < 20, and sub-tree C holds keys ≥ 20 and < 30. c. Each intermediate node must have at least 2 key values and 3 pointers.
Output of the bucket B’ occurs we have saved some I/O in comparison to the standard 2 pass algorithm.
Problem 5 (Query Optimization, 20 points) a. Exercise: 16.4.1 part (h) and (i), page 834. b. Exercise: 16.6.5, page 859.
Answer:
a.
VW a
= 1.67 (5 points)
(i) T( X (^) X. c ∞< Y (^). cY J) = 3
= 20,000 (5 points)
b. (a) Total number of trees = 7!(T(1)T(6) + T(2)T(5) + T(3)T(4) + T(4)T(3) + T(5)T(2) + T(6)T(1)) = 5040(142 + 114 + 25 + 52 + 141 + 421) = 5040 = 665, No of left-deep trees = No of right-deep trees = 7! = 5040 No of bushy trees = 5040 * 132 – 5040 * 2 = 655,200 (5 points)
(b) Total number of trees = 8!(T(1)T(7) + T(2)T(6) + T(3)T(5) + T(4)T(4) + T(5)T(3) + T(6)T(2) + T(7)T(1)) = 40320(1132 + 142 + 214 + 44 + 142 + 421 + 1321) = 40320*(132 + 42 + 28 + 16 + 28 + 42 + 132) = 40320 * 420 = 16934400 No of left-deep trees = No of right-deep trees = 8! = 40320 No of bushy trees = 40320 * 420 – 40320 * 2 = 16853760 (5 points)
Problem 4 (Transaction Management, 25 points)
(22 points) Consider the following sequence of log records:
Describe the action of the recovery manager, including changes to both disk and the log, if there is a crash and the last log record to appear on disk is:
a) <T,E,50,51> b)
Answer:
a) We find the
b) The only difference is that we know that T is committed. Thus, we have to redo it. However, we do not need to look prior to the <START CKPT (T, U)> record, because we know that T's changes prior to the start of the checkpoint were flushed to disk during the checkpoint. We set C to 31, E to 51.
We will consider Redo only solution for partial credit for this problem.