I have a parameterized cypher query that works though it seems to give issues with Bloom causing poor connection errors.
Match (a:cpc)<-[:Classified_as{sequence:0}]-(b:patent)-[r:Cites{inherited:false}]->(c:patent)-[:Classified_as{sequence:0}]->(d:cpc)
where exists{(b)-[:Assigned_to]-(:company{name:$company'})-[Assigned_to]-(c)}
with a,d, count(r) as howmany
where howmany>$threshold
Call apoc.create.vRelationship(a,'Co_Uses',{num:howmany},d) yield rel
return a,d, rel
The query profile
shows a total of 5239555 db hits and I think this is chewing up memory.
For reference I have allocated
I think the issue is the order of the node queries with the node counts as follows.
Count(cpc)= 290,000
Count(patent) = 41,600
Count(company) = 2290
My intuition is to first constrain on company, then patent and finally on cpc. Thus far I have not been successful in doing that and hence the request for guidance. I have tried inverting the initial match clause with the where clause, but the references of the cpc nodes which I need for the virtual relationships do not seem to be available in the with clause.
profile
Match (b:patent)-[:Assigned_to]-(:company{name:$company})-[:Assigned_to]-(c:patent)
Where exists{ (a:cpc)<-[:Classified_as{sequence:0}]-(b:patent)-[r:Cites{inherited:false}]->(c:patent)-[:Classified_as{sequence:0}]->(d:cpc)}
with a,d, count(r) as howmany
where howmany>$threshold
Call apoc.create.vRelationship(a,'Co_Uses',{num:howmany},d) yield rel
return a,d, rel
Variable a
not defined (line 4, column 6 (offset: 237))
"with a,d, count(r) as howmany"
Suggestions?
Andy
FYI system memory
dbms.memory.heap.initial_size=15G
dbms.memory.heap.max_size=15G
dbms.memory.pagecache.size=16G