I have this query in my app:
MATCH (ctx:Context{uid:"c1af16f0-f2fa-11e3-a477-6749dbdfc34e"}),
c-[at:AT]->ctx,
s-[in:IN]->ctx,
ctx-[by:BY]->u
WITH c,at,s,in,ctx,by,u
MATCH con-[byc:BY]->u
WHERE byc.statement = s.uid
DELETE at,in,s,byc
And it's taking ages to execute. I thought it was because of the WHERE clause, but no, even if I get rid of the WITH and go directly to DELETE, such as
MATCH (ctx:Context{uid:"c1af16f0-f2fa-11e3-a477-6749dbdfc34e"}),
c-[at:AT]->ctx,
s-[in:IN]->ctx,
ctx-[by:BY]->u
DELETE at,in,s
It's still taking too long.
It's a lot of nodes to delete (hundreds), but still, maybe I'm just doing something wrong with the query?
Let me know, please...
The basic idea is to find a node, then find all the other ones connected to it, delete those relationships, and only one type of connected nodes.
Thank you!
profile match(.....)
- Stefan Armbruster:Context(uid)
. Do you? Profile would help. - Eve FreemanLIMIT
andSKIP
to have a smaller transaction size. - Stefan Armbruster