Knowledge Base

How do I set a breakpoint in a Cypher statement for further analysis

If you wish to set a 'breakpoint' in a Cypher statement so as to perform further analysis (i.e. see how many locks are taken, memory utilization) one can add a call to apoc.utils.sleep(XXX) which will result in the query sleeping for XXXX msec.

For example:

MERGE (n:Movie {title:'The Matrix'})
set n.production_company='Warner Brothers'
with n call apoc.util.sleep(10000) return n;

will run the MERGE statement with its 'set' operation and then 'pause' for 10000 miliseconds (i.e. 10 seconds) and then return.

Further one could run

MERGE (n:Movie {title:'The Matrix'})
with n call apoc.util.sleep(10000)
set n.production_company='Warner Brothers' return n;

which will run the MERGE statement, then 'pause' for 10000 miliseconds and then run its 'set' operation on the property.

During these 10000 miliseconds one could perform any other further analysis, i.e. call dbms.listQueries() or call dbms.showActiveLocks()