Last active
July 25, 2018 20:48
-
-
Save njdart/632bbda4cff2c79988ea69a97b1ef3ce to your computer and use it in GitHub Desktop.
Arangodb index query explains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I gave up on this query after 5 minutes of waiting | |
Query string: | |
FOR v,e,p in 1..3 OUTBOUND "vertices/14773828" edges FILTER p.edges[*].type ALL == "a" RETURN p | |
Execution plan: | |
Id NodeType Est. Comment | |
1 SingletonNode 1 * ROOT | |
2 TraversalNode 1000000000 - FOR v /* vertex */, p /* paths */ IN 1..3 /* min..maxPathDepth */ OUTBOUND 'vertices/14773828' /* startnode */ edges | |
5 ReturnNode 1000000000 - RETURN p | |
Indexes used: | |
By Type Collection Unique Sparse Selectivity Fields Ranges | |
2 skiplist edges false true n/a [ `type` ] base OUTBOUND | |
Traversals on graphs: | |
Id Depth Vertex collections Edge collections Options Filter conditions | |
2 1..3 edges uniqueVertices: none, uniqueEdges: path (p.`edges`[*].`type` all == "a") | |
Optimization rules applied: | |
Id RuleName | |
1 optimize-traversals | |
2 remove-filter-covered-by-traversal | |
3 remove-unnecessary-calculations-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query string: | |
for v,e,p in 1..1 OUTBOUND "vertices/14773828" edges | |
FILTER ( | |
p.edges[*].type ANY == "a" && | |
p.vertices[*].type ANY == "a" | |
) | |
RETURN p | |
Execution plan: | |
Id NodeType Est. Comment | |
1 SingletonNode 1 * ROOT | |
2 TraversalNode 1000 - FOR v /* vertex */, p /* paths */ IN 1..1 /* min..maxPathDepth */ OUTBOUND 'vertices/14773828' /* startnode */ edges | |
3 CalculationNode 1000 - LET #9 = ((p.`edges`[*].`type` any == "a") && (p.`vertices`[*].`type` any == "a")) /* simple expression */ | |
4 FilterNode 1000 - FILTER #9 | |
5 ReturnNode 1000 - RETURN p | |
Indexes used: | |
By Type Collection Unique Sparse Selectivity Fields Ranges | |
2 edge edges false false 0.10 % [ `_from`, `_to` ] base OUTBOUND | |
Traversals on graphs: | |
Id Depth Vertex collections Edge collections Options Filter conditions | |
2 1..1 edges uniqueVertices: none, uniqueEdges: path | |
Optimization rules applied: | |
Id RuleName | |
1 optimize-traversals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query string: | |
for v,e,p in 1..1 OUTBOUND "vertices/14773828" edges FILTER e.type == "a" RETURN p | |
Execution plan: | |
Id NodeType Est. Comment | |
1 SingletonNode 1 * ROOT | |
2 TraversalNode 1000 - FOR v /* vertex */, e /* edge */, p /* paths */ IN 1..1 /* min..maxPathDepth */ OUTBOUND 'vertices/14773828' /* startnode */ edges | |
3 CalculationNode 1000 - LET #5 = (e.`type` == "a") /* simple expression */ | |
4 FilterNode 1000 - FILTER #5 | |
5 ReturnNode 1000 - RETURN p | |
Indexes used: | |
By Type Collection Unique Sparse Selectivity Fields Ranges | |
2 edge edges false false 0.10 % [ `_from`, `_to` ] base OUTBOUND | |
Traversals on graphs: | |
Id Depth Vertex collections Edge collections Options Filter conditions | |
2 1..1 edges uniqueVertices: none, uniqueEdges: path | |
Optimization rules applied: | |
none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query string: | |
for v,e,p in 1..1 OUTBOUND "vertices/14773828" edges FILTER p.edges[*].type ALL == "a" RETURN p | |
Execution plan: | |
Id NodeType Est. Comment | |
1 SingletonNode 1 * ROOT | |
2 TraversalNode 1000 - FOR v /* vertex */, p /* paths */ IN 1..1 /* min..maxPathDepth */ OUTBOUND 'vertices/14773828' /* startnode */ edges | |
5 ReturnNode 1000 - RETURN p | |
Indexes used: | |
By Type Collection Unique Sparse Selectivity Fields Ranges | |
2 skiplist edges false true n/a [ `type` ] base OUTBOUND | |
Traversals on graphs: | |
Id Depth Vertex collections Edge collections Options Filter conditions | |
2 1..1 edges uniqueVertices: none, uniqueEdges: path (p.`edges`[*].`type` all == "a") | |
Optimization rules applied: | |
Id RuleName | |
1 optimize-traversals | |
2 remove-filter-covered-by-traversal | |
3 remove-unnecessary-calculations-2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment