Improved ordering of DB query results.