Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make neo4j query last long for testing purposes?

Tags:

neo4j

cypher

We want to create a very slow query to test it in our application. Is there any way to make a Neo4j query last for a specific amount of seconds?

like image 997
Theo Avatar asked Oct 19 '25 21:10

Theo


1 Answers

I believe you can use the APOC procedure apoc.util.sleep.

According the docs:

apoc.util.sleep({duration}): sleeps for millis, transaction termination is honored

For example:

CALL apoc.util.sleep(1000) // wait for 1 second
MATCH (node) // match 'node'...
RETURN node // ... return 'node'

Please remember to install APOC procedures according the version of Neo4j you are using. Take a look in the Version Compatibility Matrix.

like image 160
Bruno Peres Avatar answered Oct 21 '25 22:10

Bruno Peres