[prev] 26 [next]

Exercise 1: Relation Scan Cost

Consider a table R(x,y,z) with 105 tuples, implemented as
  • number of tuples r = 10,000
  • average size of tuples 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
  • time to write one result page Tr = 10msec
Calculate the total time-cost for answering the query:

insert into S select * from R where x > 10;

if 50% of the tuples satisfy the condition.