[prev] 41 [next]

Exercise 5: Space Utilisation

Consider the following page/record information:
  • page size = 1KB = 1024 bytes = 210 bytes
  • records: (a:int,b:varchar(20),c:char(10),d:int)
  • records are all aligned on 4-byte boundaries
  • c field padded to ensure d starts on 4-byte boundary
  • each records has 4 field-offsets at start of record (each 1 byte)
  • char(10) field rounded up to 12-bytes to preserve alignment
  • maximum size of b values = 20 bytes; average size = 16 bytes
  • page has 32-bytes of header information, starting at byte 0
  • only insertions, no deletions or updates
Calculate C = average number of records per page.