Sort records stably in summary