avoid SQL order by on calculated fields