Neo4j 查询性能-四种关系

Neo4j 查询性能-四种关系,neo4j,cypher,Neo4j,Cypher,我的问题是: “哪一位球员最频繁地相互较量” 我问了以下问题: match (p:Player)-[:PLAYS_IN]->(t:Team)-[:PLAYED]->(g:Game)<-[:PLAYED]-(tt:Team)<-[:PLAYS_IN]-(pp:Player) USING SCAN p:Player USING SCAN pp:Player return p.Lastname, pp.Lastname, count(pp) order by count(

我的问题是: “哪一位球员最频繁地相互较量”

我问了以下问题:

match (p:Player)-[:PLAYS_IN]->(t:Team)-[:PLAYED]->(g:Game)<-[:PLAYED]-(tt:Team)<-[:PLAYS_IN]-(pp:Player) 
USING SCAN p:Player USING SCAN pp:Player  
return p.Lastname, pp.Lastname, count(pp) order by count(pp) desc limit 100;

match(p:Player)-[:PLAYS_IN]->(t:Team)-[:play]->(g:Game)我想你可以通过首先找到哪些球队相互踢得最厉害,然后在此基础上找到球员来简化问题。我不确定这个假设是否过分简化了问题

match (t:Team)-[:PLAYED]->(g:Game)<-[:PLAYED]-(tt:Team)
with t, tt order by count(g) desc limit 1
match  (p:Player)-[:PLAYS_IN]->(t:Team)-[:PLAYED]->(g:Game)<-[:PLAYED]-(tt:Team)<-[:PLAYS_IN]-(pp:Player) 
return p.Lastname, pp.Lastname, count(pp) order by count(pp) desc limit 100;

match(t:Team)-[:PLAYED]->(g:Game)(t:Team)-[:PLAYED]->(g:Game)感谢您的回答。但我想我可能讨论了笛卡尔积问题:neo4j sh(?)$match(g:Game)返回计数(g);+------------+|count(g)|+-------------+|215067 |+-------------+1行450毫秒neo4j sh(?)$match(t:Team)-[:PLAYED]->(g:Game)查看google组上的答案。。。