skip to Main Content

I am currently working with Apache AGE for graph data management and I’m executing a set of queries using AGE-Viewer-GO.

What I want to do now is measure the execution time of this (and other) queries. Is there a built-in function or feature in AGE-Viewer-GO that allows me to measure how long a query takes to execute?
If not is there a recommended way to achieve this?

2

Answers


  1. The optimal way to measure the query execution time is by using the following template written in GO:

    start := time.Now()
    // Here goes your query execution
    elapsed := time.Since(start)
    
    fmt.Println("Query took %s", elapsed)
    
    Login or Signup to reply.
  2. You can use EXPLAIN ANALYZE inside the cypher function. For example:

    SELECT * FROM cypher('test', $$                                                                    
    EXPLAIN ANALYZE MATCH (u)
    RETURN u
    $$) AS (result agtype);
    

    This will return the query plan, the planning time and the execution time for the stated query.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search