Exercise 4: Relation Scan Cost
Consider a table R with 105 tuples, implemented as
- number of records/tuples r = 100,000
- average size of records R = 200 bytes
- size of data pages B = 4096 bytes
- time to read one data page Tr = 10msec
- time to check one tuple 1 usec
- time to form one result tuple 1 usec
- overhead from scanning one page 40 usec
Calculate the total time-cost for answering the query:
select * from R where x > 10;
|
if 50% of the tuples satisfy the condition.
|