代码如下:查询用户邀请其他用户数量大于1的关系,并返回用户,被邀请用户,被邀请用户手机号码的图
match (x:userid)-[n:to_invite]->(y:userid) with id(x) as vid,count(n) as times limit 10
match p=(x:userid)-[n:to_invite]->(y:userid)-[m:join]->(z:mobile) where times > 1 and id(x) in [vid] return p
match (v:player)-[f:follow]->(w:player)-[s:serve]->(t:team) with distinct id(v) as vid, collect(id(w)) as dstvid, collect(id(t)) as phone where size(dstvid) > 1 return vid,dstvid,phone
match p=(x:userid)-[n:to_invite]->(y:userid)-[m:join]->(z:mobile)
with distinct id(x) as uvid,collect(n) as edgen,collect(id(y)) as dstvid,collect(m) as edgem,collect(id(z)) as mobile
where size(edgen)>1 return uvid,edgen,dstvid,edgem,mobile limit 10
这样好像是可以的,查询需要16s,是否还可以有优化空间呢
match (x:userid)-[n:to_invite]->(y:userid)-[m:join]->(z:mobile)
with distinct id(x) as uvid,collect(n) as edgen,collect(id(y)) as dstvid,collect(m) as edgem,collect(id(z)) as mobile
where size(edgen)>1 return uvid,edgen,dstvid,edgem,mobile limit 10
现在这个代码已经完整了,因为需要返回点,边的其他属性,这样去跑12s