How to delete large amount of nodes in cypher
up vote
2
down vote
favorite
I'm trying to delete 1 million nodes in cyphper at one query using web admin(i.e localhost:7474/browser).
These nodes is labeled as User. I ran following query, then returned Unknown error after waiting about 1minutes.
match (u:User) delete u
This query returned Unknown error every time. and I confirm my PC resources didn't lack.
I'm using Neo4j version 2.0.0 RC1 community edition. and Neo4j Hosted on local.
Is My trying way for deletion nodes wrong?
Thanks
neo4j cypher
add a comment |
up vote
2
down vote
favorite
I'm trying to delete 1 million nodes in cyphper at one query using web admin(i.e localhost:7474/browser).
These nodes is labeled as User. I ran following query, then returned Unknown error after waiting about 1minutes.
match (u:User) delete u
This query returned Unknown error every time. and I confirm my PC resources didn't lack.
I'm using Neo4j version 2.0.0 RC1 community edition. and Neo4j Hosted on local.
Is My trying way for deletion nodes wrong?
Thanks
neo4j cypher
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm trying to delete 1 million nodes in cyphper at one query using web admin(i.e localhost:7474/browser).
These nodes is labeled as User. I ran following query, then returned Unknown error after waiting about 1minutes.
match (u:User) delete u
This query returned Unknown error every time. and I confirm my PC resources didn't lack.
I'm using Neo4j version 2.0.0 RC1 community edition. and Neo4j Hosted on local.
Is My trying way for deletion nodes wrong?
Thanks
neo4j cypher
I'm trying to delete 1 million nodes in cyphper at one query using web admin(i.e localhost:7474/browser).
These nodes is labeled as User. I ran following query, then returned Unknown error after waiting about 1minutes.
match (u:User) delete u
This query returned Unknown error every time. and I confirm my PC resources didn't lack.
I'm using Neo4j version 2.0.0 RC1 community edition. and Neo4j Hosted on local.
Is My trying way for deletion nodes wrong?
Thanks
neo4j cypher
neo4j cypher
edited Aug 7 '15 at 22:54
ekkis
3,989103770
3,989103770
asked Dec 10 '13 at 7:47
Michael
53111
53111
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
5
down vote
accepted
You should do write operations with a reasonable transaction size of ~10-50k atomic operations. Therefore you can use limit
and run the statement until all users are gone:
match (u:User) with u limit 1000 delete u
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.match (u:User) with u limit 1000 delete u
It works fine:) Thanx
– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
add a comment |
up vote
0
down vote
With Neo4j 3.x and forward you can run large delete transactions using APOC too:
call apoc.periodic.iterate("MATCH (u:User) return u", "DETACH DELETE u", {batchSize:1000})
yield batches, total return batches, total
add a comment |
up vote
-3
down vote
I've found that just removing the neo4j/data
folder is the fastest way to delete the db.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
You should do write operations with a reasonable transaction size of ~10-50k atomic operations. Therefore you can use limit
and run the statement until all users are gone:
match (u:User) with u limit 1000 delete u
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.match (u:User) with u limit 1000 delete u
It works fine:) Thanx
– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
add a comment |
up vote
5
down vote
accepted
You should do write operations with a reasonable transaction size of ~10-50k atomic operations. Therefore you can use limit
and run the statement until all users are gone:
match (u:User) with u limit 1000 delete u
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.match (u:User) with u limit 1000 delete u
It works fine:) Thanx
– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
You should do write operations with a reasonable transaction size of ~10-50k atomic operations. Therefore you can use limit
and run the statement until all users are gone:
match (u:User) with u limit 1000 delete u
You should do write operations with a reasonable transaction size of ~10-50k atomic operations. Therefore you can use limit
and run the statement until all users are gone:
match (u:User) with u limit 1000 delete u
edited Apr 28 '16 at 16:56
istruble
10.1k13948
10.1k13948
answered Dec 10 '13 at 8:52
Stefan Armbruster
34.2k46374
34.2k46374
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.match (u:User) with u limit 1000 delete u
It works fine:) Thanx
– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
add a comment |
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.match (u:User) with u limit 1000 delete u
It works fine:) Thanx
– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
1
1
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.
match (u:User) with u limit 1000 delete u
It works fine:) Thanx– Michael
Dec 10 '13 at 9:21
Thank you for the advice. I tried to delete above query, but it returned an Unknown error. I executed an following query instead.
match (u:User) with u limit 1000 delete u
It works fine:) Thanx– Michael
Dec 10 '13 at 9:21
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
you're right, did a mistake in my answer.
– Stefan Armbruster
Dec 10 '13 at 10:10
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
OK, I see. Thanx
– Michael
Dec 10 '13 at 11:02
add a comment |
up vote
0
down vote
With Neo4j 3.x and forward you can run large delete transactions using APOC too:
call apoc.periodic.iterate("MATCH (u:User) return u", "DETACH DELETE u", {batchSize:1000})
yield batches, total return batches, total
add a comment |
up vote
0
down vote
With Neo4j 3.x and forward you can run large delete transactions using APOC too:
call apoc.periodic.iterate("MATCH (u:User) return u", "DETACH DELETE u", {batchSize:1000})
yield batches, total return batches, total
add a comment |
up vote
0
down vote
up vote
0
down vote
With Neo4j 3.x and forward you can run large delete transactions using APOC too:
call apoc.periodic.iterate("MATCH (u:User) return u", "DETACH DELETE u", {batchSize:1000})
yield batches, total return batches, total
With Neo4j 3.x and forward you can run large delete transactions using APOC too:
call apoc.periodic.iterate("MATCH (u:User) return u", "DETACH DELETE u", {batchSize:1000})
yield batches, total return batches, total
answered Nov 11 at 13:30
ThirstForKnowledge
578112
578112
add a comment |
add a comment |
up vote
-3
down vote
I've found that just removing the neo4j/data
folder is the fastest way to delete the db.
add a comment |
up vote
-3
down vote
I've found that just removing the neo4j/data
folder is the fastest way to delete the db.
add a comment |
up vote
-3
down vote
up vote
-3
down vote
I've found that just removing the neo4j/data
folder is the fastest way to delete the db.
I've found that just removing the neo4j/data
folder is the fastest way to delete the db.
answered Jul 28 '14 at 21:53
eighteyes
8791718
8791718
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20488801%2fhow-to-delete-large-amount-of-nodes-in-cypher%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown