I have two types nodes in my graph. 70k ARTICLE, 10k DOCTOR and 20K relationships between the nodes. I want to query all the shortest path in the graph and then filt the longest 2 path. But there is Cartesian product in the query plan and the performance is too low...My cypher query is as below:
Match p = shortestPath( (a:DOCTOR)-[n:IS_AUTHOR*1..]-(b:DOCTOR) )
with a,b,p,length(p) AS length
order by length(p) DESC limit 3
RETURN nodes(p)
Is there anything I can do to tune the performance when using global graph query? This is my query plan: