# Sorting and counting issue

**URL:** <https://discuss.dgraph.io/t/sorting-and-counting-issue/2743>\
**Category:** Dgraph\
**Created:** [June 14, 2018, 2:09pm UTC](https://discuss.dgraph.io/t/sorting-and-counting-issue/2743 "2018-06-14T14:09:23Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [August 31, 2018, 11:03pm UTC](https://discuss.dgraph.io/t/sorting-and-counting-issue/2743/13 "2018-08-31T23:03:10Z")

</div>

I believe that this problem has already been clarified. To circumvent the limitation simply use paging greater than 1000.

e.g:

```auto
 A (func: has(price), orderdesc: <price>, first: 10000 ){

```

Quoting below:

_Well folks, it’s not a bug. This is a limitation by default._

> // Sort and paginate directly as it’d be expensive to iterate over the index which  
> // might have millions of keys just for retrieving some values.

> // Only retrieve up to 1000 results by default.

> “if no “first” or “last” etc. argument is specified, it would default to 1000.” mrjn.

> <https://github.com/dgraph-io/dgraph/blob/06ea4c545bc3cf0ed730327557dbff96406e75f8/query/query.go#L2146>

Thank you for reporting this.

Cheers.

---

_[View the full topic](https://discuss.dgraph.io/t/sorting-and-counting-issue/2743)._
