Below is the context: Suppose I have a relation Grades(student_id, assignment_id, score). I have 200 students and 20 assignments. I would grade all submissions of
Below is the context:
Suppose I have a relation Grades(student_id, assignment_id, score). I have 200 students and 20 assignments. I would grade all submissions of one assignment based on the submission order, and then insert the records. As a result, based on my insertion nature, the student_id is not sorted, but the assignment_id is. I choose heap file as my file organization. My page is quite small it can only store 40 records, or 200 bytes in one page. The SearchKeySize is 2 bytes and PointerSize is 2 bytes. My buffer size is also small, 4 pages.
Here are the problems I need help with:
If my most frequent query is to find all scores for an assignment, such as select score from grades where assignment_id=01; select score from grades where assignment_id=14;
A) What is the I/O cost if I dont build index for assignment_id? (note: assignment_id is sorted and each assignment_id can appear as many as 200 times in this relation)
B) Suppose I decide to build B+ tree index. What is the smallest number of pages do you estimate the B+ tree will take?
C) What is the best I/O cost for answering those queries with B+ tree index now?
D) Suppose at the end of the semester, I need to curve the grades. I decide to increase all scores by 5 points. What is the I/O cost for this operation?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started