简体   繁体   English

性能问题我在返回整个对象时进行 Arango 查询

[英]Performance Issue i Arango query while returning the whole Object

I am new to ArangoDB .我是 ArangoDB 的新手。 Needed some help in improving performance of a query .需要一些帮助来提高查询的性能。

Tech specs: ArangoDb(3.6.2) , Java 8 Springboot application(2.xx) .技术规格: ArangoDb(3.6.2) ,Java 8 Springboot 应用程序(2.xx) 。

I am trying to run a query where it returns an object after merging data from couple of Graphs .我正在尝试运行一个查询,它在合并来自几个 Graphs 的数据后返回一个对象。 The query runs infinitely when i directly return the object , where it runs faster(like 75 secs) when i just return an element of the object .当我直接返回对象时,查询会无限运行,当我只返回对象的一个​​元素时,它运行得更快(如 75 秒)。

for d in data
        return d

Output:输出:

[{
accntDtl:{ //account detials here
         },
accntPrfl:{//accnt profile here
            },
//few other parameters
}]

return d - runs infinitely . return d - 无限运行。

whereas, return d.accnt[0].accntDtl[0].accntId - executes in 75 secs..return d.accnt[0].accntDtl[0].accntId - 在 75 秒内执行..

What can be a possible solution to increase its performance ?什么是提高其性能的可能解决方案?

Note: This query returns around 2 million record .注意:此查询返回大约 200 万条记录。

For confidentiality purpose , i am unable to post the whole query here .出于保密目的,我无法在此处发布整个查询。

Thanks in advance .提前致谢 。

Updates: Included AqlQueryOptions for streaming .更新:包括用于流媒体的 AqlQueryOptions。

aqlQueryOptions.stream(true),aqlQueryOptions.batchSize(10000)

Consuming the same :消费相同:

while(cursor.hasNext()){
  result = cursor.next();
  //deserilize result as doc
  resultList.add(doc)
  ..... processing the data
}

But this iteration is happening 1 by 1 and not in a batch of 10,000 as specified in the batchSize param .但是此迭代是 1 次 1 次进行的,而不是按照 batchSize 参数中指定的 10,000 次进行。 I am pretty sure, the way am consuming the cursor is not advisable .我很确定,使用游标的方式是不可取的。 Kindly suggest the best way to consume this data in a batch of 10,000 at each iteration .请建议在每次迭代中以 10,000 个批次使用此数据的最佳方法。

For such query would be beneficial using a streaming cursor, setting stream to true on AQL cursor creation.对于这样的查询,使用流游标将是有益的,在 AQL 游标创建时将stream设置为true

Here is the reference documentation:这是参考文档:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM