# The query time is very long, 7 seconds on average. How to optimize it?

**URL:** <https://discuss.dgraph.io/t/the-query-time-is-very-long-7-seconds-on-average-how-to-optimize-it/5259>\
**Category:** Users\
**Created:** [October 18, 2019, 6:59am UTC](https://discuss.dgraph.io/t/the-query-time-is-very-long-7-seconds-on-average-how-to-optimize-it/5259 "2019-10-18T06:59:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiankonghewo](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/tiankonghewo/32/2149_2.png) [@tiankonghewo](https://discuss.dgraph.io/u/tiankonghewo)\
**Post date:** [October 18, 2019, 6:59am UTC](https://discuss.dgraph.io/t/the-query-time-is-very-long-7-seconds-on-average-how-to-optimize-it/5259/1 "2019-10-18T06:59:12Z")

</div>

dgrapg version is 1.0.15  
import stage:  
rdf data size is 400G,  
node memory size is 256GB  
Originally I wanted to use the new version v1.1.0, but when importing data, the new version always reported an OOM error at map stage. So I had to use the old version 1.0.x

when run up, my cluster server configuration is:  
3 nodes:16core64G  
each data:170G,380G,440G

second, my query is very simple, use pydgraph==1.2.0,my dgraph version is 1.0.15  
but the query time is very long, 7 seconds on average

> query = “”“query all($a: string, $value: string) {  
> all(func: eq(type, $a))[@filter](https://github.com/filter)(eq(value, $value)) {  
> uid  
> type  
> value  
> }  
> }”“”  
> variables = {‘$a’: ‘PERSON’, ‘$value’: value}  
> t0 = time.time()  
> res = client.txn(read\_only=True).query(query, variables=variables)  
> ppl = json.loads(res.json)

Finally, I would like to ask, for TB data size,  
What is the recommended cluster size and node configuration?  
Is there any production case for reference?  
If I need to add nodes, how many should I add? 3 or 6

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [November 17, 2019, 6:59am UTC](https://discuss.dgraph.io/t/the-query-time-is-very-long-7-seconds-on-average-how-to-optimize-it/5259/2 "2019-11-17T06:59:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
