I am profiling a query with cypher-shell, since according to this post it is easier to be compared.
My command is something like the following (the query is different).
sudo cypher-shell -a myip:myport -u myusr -p 'my_pwd' "EXPLAIN MATCH (t1:Node1{field:1})−[:rel1]−>
( : Node2 {ID :"01"})<−[:rel1]−(t2:Trip{Direction:0})
RETURN t1, t2 LIMIT 1;"
This command print the profiling of the query to Terminal. However, it is difficult to read on the Terminal so I was trying to redirect the output to file such as:
sudo cypher-shell -a myip:myport -u myusr -p 'my_pwd' "EXPLAIN MATCH (t1:Node1{field:1})−[:rel1]−>
( : Node2 {ID :"01"})<−[:rel1]−(t2:Node2{field:0})
RETURN t1, t2 LIMIT 1;" >> out.txt
However, the resulting file contains no profiling but only a couple of lines such as:
Plan: "EXPLAIN"
Statement: "READ_ONLY"
Version: "CYPHER 3.5"
Planner: "COST"
Runtime: "INTERPRETED"
Time: 0
How to redirect neo4j profiling output to file?
Add the --format verbose
flag to the command.
sudo cypher-shell -a myip:myport -u myusr -p 'my_pwd' --format verbose "EXPLAIN MATCH (t1:Node1{field:1})−[:rel1]−>
( : Node2 {ID :"01"})<−[:rel1]−(t2:Node2{field:0})
RETURN t1, t2 LIMIT 1;" >> out.txt
cypher-shell
seems to default to --format plain
if output is being redirected to a file.