Optimize criteria calculation performance in case of sort by multi fields