Changed key sorting for range queries