收到,
。
要实现两点间全部最短路径的能力。
neo4j 3.3版本,
MATCH p = allShortestpaths((a)-[:关系*…5]-(b)) where id(a)=46585354 and id(b)=491880699 return p limit 500,通过这条语句可以找到,速度很快(dbms.query_cache_size=0,没有缓存查询语句),几百毫秒。
nebula 3.4.1中,MATCH p = allShortestpaths((a)-[:关系*…5]-(b)) where id(a)==11807506 and id(b)==3298752276 return p limit 500,查找时间1分钟。
FIND SHORTEST PATH WITH PROP FROM 11807506 TO 3298752276 OVER 关系 UPTO 5 steps YIELD path as p|limit 500,查找时间50秒。
profile find path,发现 GetNeighbors 花费9s,BFSShortest 花费35s。
11807506相关的点和边,3跳就能达到千万,nebula花费这么久,能说的通~,
问题1:
执行这个查询的graphd服务,内存大约消耗7个G,根据文档,无属性边最少占用:1+3+8+4+8+8+1=33字节,33*2kw差不多630MB,为什么会相差这么大呢?
问题2:为啥neo4j才花费那么点时间?
BFSShortest
[
{
"execTime": "10(us)",
"rows": 0,
"totalTime": "686(us)",
"version": 0
},
{
"execTime": "9(us)",
"rows": 0,
"totalTime": "489981(us)",
"version": 1
},
{
"execTime": "13(us)",
"rows": 0,
"totalTime": "34347697(us)",
"version": 2
}
]
GetNeighbors_3
[
{
"execTime": "111(us)",
"resp[0]": {
"exec": "973(us)",
"host": "10.100.15.44:9779",
"storage_detail": {
"GetNeighborsNode": "640(us)",
"HashJoinNode": "447(us)",
"RelNode": "641(us)",
"SingleEdgeNode": "403(us)"
},
"total": "1743(us)",
"vertices": 1
},
"rows": 529,
"totalTime": "1940(us)",
"total_rpc_time": "1812(us)",
"version": 0
},
{
"execTime": "466(us)",
"resp[0]": {
"exec": "26653(us)",
"host": "10.100.15.44:9779",
"storage_detail": {
"GetNeighborsNode": "142422(us)",
"HashJoinNode": "97052(us)",
"RelNode": "142459(us)",
"SingleEdgeNode": "94658(us)"
},
"total": "70814(us)",
"vertices": 235
},
"resp[1]": {
"exec": "53069(us)",
"host": "10.100.0.112:9779",
"storage_detail": {
"GetNeighborsNode": "110431(us)",
"HashJoinNode": "41398(us)",
"RelNode": "110452(us)",
"SingleEdgeNode": "40271(us)"
},
"total": "128408(us)",
"vertices": 110
},
"rows": 347109,
"totalTime": "129317(us)",
"total_rpc_time": "128821(us)",
"version": 1
},
{
"execTime": "103356(us)",
"resp[0]": {
"exec": "2943393(us)",
"host": "10.100.15.44:9779",
"storage_detail": {
"GetNeighborsNode": "71545142(us)"
"HashJoinNode": "63424577(us)",
"RelNode": "71562824(us)",
"SingleEdgeNode": "62971191(us)"
},
"total": "8650711(us)",
"vertices": 106627
},
"resp[1]": {
"exec": "1315004(us)",
"host": "10.100.0.112:9779",
"storage_detail": {
"GetNeighborsNode": "23985410(us)"
"HashJoinNode": "20991293(us)",
"RelNode": "23992812(us)",
"SingleEdgeNode": "20794508(us)"
},
"total": "4262509(us)",
"vertices": 53388
},
"rows": 25923066,
"totalTime": "8803861(us)",
"total_rpc_time": "8700464(us)",
"version": 2
}
]
GetNeighbors_4
[ {
"execTime": "147(us)",
"resp[0]": {
"exec": "638(us)",
"host": "10.100.0.112:9779",
"storage_detail": {
"GetNeighborsNode": "344(us)",
"HashJoinNode": "333(us)",
"RelNode": "344(us)",
"SingleEdgeNode": "299(us)"
},
"total": "67637(us)",
"vertices": 1
},
"rows": 8,
"totalTime": "67875(us)",
"total_rpc_time": "67707(us)",
"version": 0
},
{
"execTime": "121(us)",
"resp[0]": {
"exec": "720(us)",
"host": "10.100.15.44:9779",
"storage_detail": {
"GetNeighborsNode": "1075(us)",
"HashJoinNode": "1051(us)",
"RelNode": "1075(us)",
"SingleEdgeNode": "914(us)"
},
"total": "4391(us)",
"vertices": 3
},
"rows": 15,
"totalTime": "4605(us)",
"total_rpc_time": "4466(us)",
"version": 1
},
{
"execTime": "137(us)",
"resp[0]": {
"exec": "700(us)",
"host": "10.100.15.44:9779",
"storage_detail": {
"GetNeighborsNode": "1002(us)",
"HashJoinNode": "960(us)",
"RelNode": "1003(us)",
"SingleEdgeNode": "832(us)"
},
"total": "1582(us)",
"vertices": 3
},
"rows": 23,
"totalTime": "1808(us)",
"total_rpc_time": "1651(us)",
"version": 2
}
]