[prev] 54 [next]

Exercise 5: Cost of Relation Copy

Analyse cost for relation copying:

  1. if both input and output are heap files
  2. if input is sorted and output is heap file
  3. if input is heap file and output is sorted

Assume ...

  • r records in input file, c records/page
  • bin = number of pages in input file
  • some pages in input file are not full
  • all pages in output file are full (except the last)

Give cost in terms of #pages read + #pages written