# Why would \`count\` function exceed response size limitation ？

**URL:** <https://discuss.dgraph.io/t/why-would-count-function-exceed-response-size-limitation/13625>\
**Category:** Dgraph\
**Tags:** kind:bug\
**Created:** [April 10, 2021, 3:19am UTC](https://discuss.dgraph.io/t/why-would-count-function-exceed-response-size-limitation/13625 "2021-04-10T03:19:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ro0tk1t](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ro0tk1t/32/6061_2.png) [@Ro0tk1t](https://discuss.dgraph.io/u/Ro0tk1t)\
**Post date:** [April 10, 2021, 3:19am UTC](https://discuss.dgraph.io/t/why-would-count-function-exceed-response-size-limitation/13625/1 "2021-04-10T03:19:46Z")

</div>

when i do a query to get a counter, there always exceed the response size limitation. actually the response only several kb size.

the query like:

```auto
$ curl -H 'Content-Type:application/dql' 127.0.0.1:8080/query -d '{
a(func:type(A))@filter(eq(field1, value1)){
    a as ~A
} 
b(func:uid(a)) {
    B @filter(eq(field2, value2)){
        b as ~B
    }
}
end(func:uid(b)){
    count(uid)}
}' | jq
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 327 100 178 100 149 6 5 0:00:29 0:00:26 0:00:03 37
{
  "errors": [
    {
      "message": "while running ToJson: estimated response size: 16358122716 is bigger than threshold: 4294967296",
      "extensions": {
        "code": "ErrorInvalidRequest"
      }
    }
  ],
  "data": null
}

```

the relationship of type A/B/C looks like:  
 ![image](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/3/357f725e806b93fe5368dbd96d49380008a872c6.png)

the normal response will just include count field, example:

```auto
{
  "data": {
    "a": [],
    "b": [],
    "end": [
      {
        "count": 54321
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 100531,
      "processing_ns": 30463511,
      "encoding_ns": 61335626,
      "assign_timestamp_ns": 1027941,
      "total_ns": 93051248
    },
    "txn": {
      "start_ts": 1853380,
      "hash": "28ca9250632810a407cebff6735ab545da6da8a33d44aadb418639213e4350e6"
    },
    }
  }
}

```

so why would the response size exceed limitation ?

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [April 12, 2021, 12:05am UTC](https://discuss.dgraph.io/t/why-would-count-function-exceed-response-size-limitation/13625/2 "2021-04-12T00:05:40Z")

</div>

This looks like it might be a bug. Let me investigate.

---

<div class="post-metadata">

**Author:** ![Ro0tk1t](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ro0tk1t/32/6061_2.png) [@Ro0tk1t](https://discuss.dgraph.io/u/Ro0tk1t)\
**Post date:** [April 12, 2021, 11:02am UTC](https://discuss.dgraph.io/t/why-would-count-function-exceed-response-size-limitation/13625/3 "2021-04-12T11:02:25Z")

</div>

will it be fixed ? when ?
