cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Deleting nodes taking a lot of time and crashing server

shubham
Node Clone

Hello guys,
i want to delete the complete database and there are ~3,00,000 nodes and ~82,00,000 relationship and i tried all basic steps to delete them and most of the time query crashes the server and we have to restart it again and when i set the limit very small , in some case it doesn't take time and in some cases it keeps on running.
any suggestion?

9 REPLIES 9

Hello @shubham

CALL apoc.periodic.iterate('MATCH (n) RETURN n', 'DETACH DELETE n', {batchSize:1000})

Regards,
Cobra

shubham
Node Clone

getting this error -
"Cannot truncate a negative index. Tried to truncate from 8870"

Do you have index or constraints?

shubham
Node Clone

Dropped all of them. Now, there is none.

Can you execute again the cypher query I gave you?

tried, getting same error.

Try this query

match(n:org_name) detach delete n;

12kunal34
Graph Fellow

If you are using local then go to folder of your data and delete the database which you want to delete .
folder location should be /neo4j--data--dbms
Note: If you want to delete whole data in your database

Which version of Neo4j are you using?
Could you reinstall a new database with the latest version available?