Optimise sort for log