ArangoDB升级到3.11.6后带权重属性的K_SHORTEST_PATHS查询无响应
ArangoDB 3.11.6版本K最短路径查询性能异常
问题详情
将ArangoDB从3.10版本升级至3.11.6版本后,执行带权重属性的K最短路径查询时出现长时间无响应的异常:
- 无权重配置的基础路径查询:
FOR path IN OUTBOUND K_SHORTEST_PATHS 'points/1' TO 'points/20' ways LIMIT 1 RETURN path,可在1ms内完成。 - 带权重配置的查询:
FOR path IN OUTBOUND K_SHORTEST_PATHS 'points/1' TO 'points/20' ways OPTIONS { weightAttribute: 'cost', defaultWeight: 1000 } LIMIT 1 RETURN path,运行10分钟仍无结果返回。
该问题在3.10版本中未出现,测试使用安道尔道路图数据集。
查询执行计划
{"plan": {"nodes": [{"type": "SingletonNode","dependencies": [],"id": 1,"estimatedCost": 1,"estimatedNrItems": 1},{"type": "EnumeratePathsNode","dependencies": [1],"id": 2,"estimatedCost": 74.91332290800307,"estimatedNrItems": 1,"database": "andorra","graph": ["ways"],"isLocalGraphNode": false,"isUsedAsSatellite": false,"defaultDirection": 2,"directions": [2],"edgeCollections": ["ways"],"vertexCollections": ["ways"],"collectionToShard": {},"optimizedOutVariables": [],"isSmart": false,"isDisjoint": false,"forceOneShardAttributeValue": false,"tmpObjVariable": {"id": 2,"name": "1","isFullDocumentFromCollection": false},"tmpObjVarNode": {"type": "reference","typeID": 45,"name": "1","id": 2},"tmpIdNode": {"type": "value","typeID": 40,"value": "","vTypeID": 4},"options": {"parallelism": 1,"produceVertices": true,"maxProjections": 5,"minDepth": 1,"maxDepth": 1,"weightAttribute": "cost","defaultWeight": 1000,"type": "shortestPath"},"indexes": {"base": [{"id": "1","type": "edge","name": "edge","fields": ["_from"],"selectivityEstimate": 0.5408036454018227,"unique": false,"sparse": false}]},"shortestPathType": "K_SHORTEST_PATHS","pathOutVariable": {"id": 0,"name": "path","isFullDocumentFromCollection": false},"startVertexId": "points/1","targetVertexId": "points/20","fromCondition": {"type": "n-ary and","typeID": 62,"subNodes": [{"type": "compare ==","typeID": 25,"excludesNull": false,"subNodes": [{"type": "attribute access","typeID": 35,"name": "_from","subNodes": [{"type": "reference","typeID": 45,"name": "1","id": 2}]},{"type": "value","typeID": 40,"value": "","vTypeID": 4}]}]},"toCondition": {"type": "n-ary and","typeID": 62,"subNodes": [{"type": "compare ==","typeID": 25,"excludesNull": false,"subNodes": [{"type": "attribute access","typeID": 35,"name": "_to","subNodes": [{"type": "reference","typeID": 45,"name": "1","id": 2}]},{"type": "value","typeID": 40,"value": "","vTypeID": 4}]}]}},{"type": "LimitNode","dependencies": [2],"id": 3,"estimatedCost": 75.91332290800307,"estimatedNrItems": 1,"offset": 0,"limit": 1,"fullCount": false},{"type": "ReturnNode","dependencies": [3],"id": 4,"estimatedCost": 76.91332290800307,"estimatedNrItems": 1,"inVariable": {"id": 0,"name": "path","isFullDocumentFromCollection": false},"count": true}],"rules": [],"collections": [{"name": "ways","type": "read"}],"variables": [{"id": 0,"name": "path","isFullDocumentFromCollection": false},{"id": 2,"name": "1","isFullDocumentFromCollection": false}],"estimatedCost": 76.91332290800307,"estimatedNrItems": 1,"isModificationQuery": false},"cacheable": true,"warnings": [],"stats": {"rulesExecuted": 43,"rulesSkipped": 0,"plansCreated": 1,"peakMemoryUsage": 0,"executionTime": 0.0002441999999973632},"error": false,"code": 200}
内容的提问来源于stack exchange,提问作者Michaël Mathieu
相关产品推荐
相关产品推荐

