你好,我写了下面两个查询,我想并行运行这些查询,而不是顺序执行它们。在ArangoDB的社区版中可以并行执行它们吗?
FOR d IN Transaction
FILTER d._to == "Account/123"
COLLECT AGGREGATE length = COUNT_UNIQUE(d._id),
totamnt = SUM(d.Amount),
daysactive = COUNT_UNIQUE(DATE_TRUNC(d.Time, "day"))
RETURN {
"Incoming Accounts": length ,
"Days Active": LENGTH(daysactive),
"Total Amount": totamnt
}
FOR d IN Transaction
FILTER d._from == "Account/123"
COLLECT AGGREGATE length = COUNT_UNIQUE(d._id),
totamnt = SUM(d.Amount),
daysactive = COUNT_UNIQUE(DATE_TRUNC(d.Time, "day"))
RETURN {
"Outgoing Accounts": length ,
"Days Active": LENGTH(daysactive),
"Total Amount": totamnt
}
1条答案
按热度按时间6ovsh4lw1#
当然,并行运行多个请求是可能的,只需向
_api/cursor
发出两个curl调用,或者使用两个不同的arangosh
shell。或者在同一个shell中运行2个curl调用,并对每个请求使用
x-arango-async
头来异步检索结果,如下所示:https://www.arangodb.com/docs/stable/http/async-results-management.html#async-execution-and-later-result-retrieval