简体   繁体   中英

Performance issue with Graph Traversal in ArangoDB

I've set up a simple test case to finally learn some graph databases

I have a simple tree structure based on a collection of roughly 80000 vertices/documents, with around 25 attributes each. The only edges are outbound "is_parent" edges, so to find children of each node, I can simple pick up all inbound edges. I have not set up any specific indices on any fields. The tree is 20 levels deep and I'm grabbing a random node on the fifth level, to then pick up all descendants of that node using a graph traversal:

FOR t IN GRAPH_TRAVERSAL("sample_tree", "sampleunit/2565130142666", "inbound",  {"maxDepth":20}) RETURN t'

This takes a little more than 3 seconds on my dev machine and I feel I might be doing something wrong. Is there any way to speed things up or do I have any conceptual issues?

I set up an example tree-like graph as you described and ran the query on it.

Interestingly, the following query was executing much faster than your query:

FOR t IN TRAVERSAL(sampleunit, unitlinks, "sampleunit/2565130142666", "inbound",  {"maxDepth":20}) RETURN t

The query above uses the "older" traversal function in AQL. We checked why there is a performance difference between the two traversal types, and finally found something that can be improved.

The fix for this has been pushed into the 2.2 and devel branches. It is included in commit 9a1eb149aa4da514d709c43a4ebdfd8819ba2f1d if you prefer cherry-picking.

我在版本2.6.3上看到NEIGHBORS和GRAPH_NEIGHBORS之间的类似问题,第一个比第二个快30倍。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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