neo4j 3.5版本。25万节点 40万关系,建了模式索引,但是查询很慢
发布于 2 年前 作者 null123 530 次浏览 来自 问答

查询语句执行需要6秒: match data=allshortestpaths((na:公司)-[*0…8]-(nb:公司)) where na.entcode = ‘91387093874923223’ return data LIMIT 5000 配置: 服务器dbms.memory.pagecache.size 是10G, dbms.memory.heap.initial_size 2G dbms.memory.heap.max_size 2G, 索引 : create index on :公司(entcode) 怎么优化下查询啊

5 回复

指定nb节点,批量并发查询 参考并发查询过程:

https://blog.csdn.net/superman_xxx/article/details/120753333

@crazyyanchao nb节点没法指定啊,需要查na这个公司经过指定路径后能关联到的所有公司。

@null123 可以使用下面这个单源起点最短路径算法试试,config中配置一个nodeQuery。其实运行步骤和我上面说的类似,还是先找到节点然后求最短路径

algo.shortestPath.deltaStepping.stream

@crazyyanchao 我这里用了 allshortestpaths ,就是最短路径了啊

用apoc的expand path procedure来代替cypher,这种全图操作最好用图算法或者apoc,cypher跑起来吃力

回到顶部