sort to_records's keys