Compute offsets for the entire database