我的match查询语句:
match p=(nn:player{player_name:"job"})-[r:friend*4..6]->(m:player)
where all(a in r where a.period in ["child","youth"]) and ((not (m)-[]->()) or (m.player.phone is not null and (m)-[]->()))
RETURN m.player.player_name as end_id , nodes(p) as result limit 2000
因为match语句性能太低,如何转换成go语句呢?
十分感谢您的帮助!!!!!!!!
如果从一个节点出发,4-5跳,返回路径中的所有节点,并且可以对路径进行条件选择,这个需求应该怎么实现呢,
了解到 GET SUBGRAPH 是可以返回路径中的所有节点的,但是无法添加where语句,请问您有什么建议不?
match 和 go 做的事情是不太一样的,不太好转化。可以看看是不是能把 where 里面的 condition 转化成 pattern 放到 match 里面,可能性能会好一些。
属性是可以放在 match 语句里面的,参考:
nebula> MATCH (v:player{name:"Tim Duncan"})-[e:follow{degree:95}]->(v2) \
RETURN e;
+--------------------------------------------------------+
| e |
+--------------------------------------------------------+
| [:follow "player100"->"player101" @0 {degree: 95}] |
| [:follow "player100"->"player125" @0 {degree: 95}] |
+--------------------------------------------------------+
user51
2022 年8 月 29 日 10:14
11
你这语句跑多久啊?我这匹配30多边,有些边 上亿数据量
user59
2022 年8 月 29 日 10:23
12
跑到停不下来,已经换策略了,采用 get subgraph 来获得整个的子图,然后再对获取的数据进行条件筛选。
user51
2022 年8 月 29 日 10:25
13
我是从子图查,转的go ,子图限制多,性能上还没看到优势,也是蛋疼
system
关闭
2022 年9 月 28 日 10:25
14
此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。