We are running a lot of operations where the first statement in each is to get the set of nodes to operate on. For many, its the same set of nodes over and over again. Its not predictable time to time so its not something I can just assign an attribute for. Normally, I just have a starting node, run the tree and collect all the subnodes. Then I run about 106 different cypher statements on that collection.
But each query has to "re collect" the nodes. That seems like a waste of time since its the same nodes the previous query collected. I could add a temporary attribute to make it simpler to find but that doesn't seem terribly efficient either.
Is there a way to create a set of nodes in a variable and have that variable persist query to query ?