1
0
Fork 0
arangodb/Documentation/Examples/GRAPHTRAV_07_traverse_7.gen...

59 lines
2.5 KiB
Plaintext

arangosh> db._explain("FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph' LET localScopeVar = RAND() > 0.5 FILTER p.edges[0].theTruth != localScopeVar RETURN v._key", {}, {colors: false});
Query string:
FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph' LET localScopeVar = RAND() > 0.5
FILTER p.edges[0].theTruth != localScopeVar RETURN v._key
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
2 TraversalNode 1 - FOR v /* vertex */ , e /* edge */ , p /* paths */ IN 1..3 /* min..maxPathDepth */ OUTBOUND 'circles/A' /* startnode */ GRAPH 'traversalGraph'
3 CalculationNode 1 - LET localScopeVar = RAND() > 0.5 /* simple expression */
4 CalculationNode 1 - LET #4 = p.`edges`[0].`theTruth` != localScopeVar /* simple expression */
5 FilterNode 1 - FILTER #4
6 CalculationNode 1 - LET #6 = v.`_key` /* attribute expression */
7 ReturnNode 1 - RETURN #6
Indexes used:
none
Traversals on graphs:
Id Depth Vertex collections Edge collections Filter conditions
2 1..3 circles edges
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 move-calculations-down
arangosh> db._explain("FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph' FILTER p.edges[0].label == 'right_foo' RETURN v._key", {}, {colors: false});
Query string:
FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph' FILTER p.edges[0].label == 'right_foo'
RETURN v._key
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
2 TraversalNode 1 - FOR v /* vertex */ , e /* edge */ , p /* paths */ IN 1..3 /* min..maxPathDepth */ OUTBOUND 'circles/A' /* startnode */ GRAPH 'traversalGraph'
3 CalculationNode 1 - LET #3 = p.`edges`[0].`label` == "right_foo" /* simple expression */
4 FilterNode 1 - FILTER #3
5 CalculationNode 1 - LET #5 = v.`_key` /* attribute expression */
6 ReturnNode 1 - RETURN #5
Indexes used:
none
Traversals on graphs:
Id Depth Vertex collections Edge collections Filter conditions
2 1..3 circles edges `Path`.`edges`[0] -> e.`label` == "right_foo"
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 move-filters-up
3 move-calculations-up-2
4 move-filters-up-2
5 merge-traversal-filter