An exact method for shrinking pivot tables