0
votes

This is part of the execution plan that arango gave me.

Execution plan:
Id   NodeType                  Est.   Comment
40   CalculationNode            900           - LET now = DATE_NOW()   /* v8 expression */

As you can see, DATE_NOW() is costing 900. However, when I write a simplie query that only returns the value of DATE_NOW(), the execution cost is 1, just like below.

Execution plan:
 Id   NodeType          Est.   Comment
  1   SingletonNode        1   * ROOT
  2   CalculationNode      1     - LET #0 = DATE_NOW()   /* v8 expression */
  3   ReturnNode           1     - RETURN #0

I wish to know,
1. How does ArangoDB calculates the execution cost?
2. What does execution cost represents?

1

1 Answers

0
votes

You need to provide a complete plan for the first query like:

Query String:
 LET now = DATE_NOW() RETURN now

Execution plan:
 Id   NodeType          Est.   Comment
  1   SingletonNode        1   * ROOT
  2   CalculationNode      1     - LET now = 1548315869319   /* json expression */   /* const assignment */
  4   ReturnNode           1     - RETURN now

Indexes used:
 none

Optimization rules applied:
 Id   RuleName
  1   move-calculations-up
  2   remove-redundant-calculations
  3   remove-unnecessary-calculations

The estimate is the number of documents produced or seen by that node.