ArangoDB。长时间查询

时间:2018-11-22 13:44:51

标签: nosql arangodb aql

我有ArangoDB查询。该查询通常执行正常,但是突然太长了

WITH
DependantPerson, PersonServiceProfile, MonitoringRule, DeviceSensor, PersonDevice, Subscription, Person, Link, DeviceApplication, Contact
FOR res IN @resource_from
LET sub = (FOR e, v, p IN @min_depth..@max_depth INBOUND res  Link FILTER (p.vertices[*].type ANY == "DeviceSensor") RETURN p)
RETURN {
  [res]:sub[*
    RETURN {
      relations: CURRENT.edges[* FILTER (CURRENT.type != "Link" && CURRENT.type != "ObserveLink") RETURN CURRENT ],
      resources: CURRENT.vertices[* FILTER (CURRENT.type == "DeviceSensor" && CURRENT.attributes.deviceId == @id) RETURN CURRENT ]
      }
    ] 
}

缓存已关闭

require("@arangodb/aql/cache").properties()
{
  "mode" : "off",
  "maxResults" : 128
}

我该如何优化?谢谢

0 个答案:

没有答案