Most efficient way to Clone a Branch from a top level node

(Johncrockeratwork) #1


We have a requirement to clone a tree from a given root node into exactly the same tree structure from a newly created Root node. The cloned tree only has to traverse down to level "n" and only traverse certain relationships.

Does anyone have any suggestions for the most efficient way of doing this? Our initial experiments have taken somewhere in the region of "minutes" and have put a medium-large load on the server.

(Tim Hanssen) #2


Can you share your query are you are running it now? And tell me a bit more about the scope, how many nodes on avg ect.

(Andrew Bowman) #3

I answered a similar question on Stack Overflow recently, are you the same one who asked that question?

If not, then my answer may be helpful for you.

If so, then it would help to know what's going on in the query, and I'd request you PROFILE your query and add the query plan (after expanding all elements of the plan) to your question.