Skip to content

Instantly share code, notes, and snippets.

@njdart
Last active July 25, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njdart/632bbda4cff2c79988ea69a97b1ef3ce to your computer and use it in GitHub Desktop.
Save njdart/632bbda4cff2c79988ea69a97b1ef3ce to your computer and use it in GitHub Desktop.
Arangodb index query explains
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
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
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
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