This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS411 Database Systems Fall 2008 Final Exam Solutions Problem 1 ( 15 points ) (1) False; (2) False; (3) False; (4) True; (5) False; (6) True; (7) False; (8) True; (9) True; (10) True; (11) False; (12) False; (13) False; (14) True; (15) True; Problem 2 ( 12 points ) (i) It may be convenient to have the length in the record itself. The length field allows us to avoid examining the record contents if all we need is to find the beginning of the next record quickly. (ii) (a) – record header: 12 bytes – name field: 30 bytes. Since each field must start at a multiple of four, this field actually takes 32 bytes. – gender field: 1 byte. Since each field must start at a multiple of four, this field actually takes 4 bytes. – address field: 255 bytes + string’s endmarker = 256 bytes. RecordLength = 12 + 32 + 4 + 256 (b) – block header: 40 bytes – actual block length: 2 20- 40 – record length: RecordLength Maximum Number of Records = ⌊ ActualBlockLength/RecordLength ⌋ Problem 3 ( 10 points ) (a) (b) B-tree index is great for both equality and range queries. However, hash table index is more efficient for equality queries, but it cannot support range queries. Problem 4 ( 12 points ) (i) Read R into main memory. Then, for each tuple t of S, find those tuples in memory with which t joins, and output the joined tuples. Also mark as “used” all those tuples of R that join with t. After S is exhausted, examine the tuples in main memory, and for each tuple rjoin with t....
View Full Document
- Fall '08
- main memory, Tuple, Coordinator, disk I/O