Skip to main content

GRAPH.SLOWLOG

Returns a list containing up to 10 of the slowest queries issued against the given graph ID.

Each item in the list has the following structure:

  1. A Unix timestamp at which the log entry was processed.
  2. The issued command.
  3. The issued query.
  4. The amount of time needed for its execution, in milliseconds.

Examples​

Get slowlog​

from falkordb import FalkorDB
db = FalkorDB(host='localhost', port=6379)
graph = db.select_graph('graph_id')
slowlog = graph.slowlog()
print(slowlog)

Sample Output​

GRAPH.SLOWLOG graph_id
1) 1) "1581932396"
2) "GRAPH.QUERY"
3) "MATCH (a:Person)-[:FRIEND]->(e) RETURN e.name"
4) "0.831"
2) 1) "1581932396"
2) "GRAPH.QUERY"
3) "MATCH (me:Person)-[:FRIEND]->(:Person)-[:FRIEND]->(fof:Person) RETURN fof.name"
4) "0.288"

Reset slowlog​

graph.slowlog_reset()

Once cleared the information is lost forever.