Exercise 5: Cost of Relation Copy
Analyse cost for relation copying:
- if both input and output are heap files
- if input is sorted and output is heap file
- 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
|