Could you have used an index, rather than sorting the format dataset?