neo4j语句优化
explain match(n:User{userId:1})
match(n)-[:gameSecond]->(game)<-[:gameSecond]-(m:User)
where m.gender=2 and m.lastOnlineTimeStamp>0 and not (n)-[:friend]-(m)
with n,m,count(game) as gs ,collect(game.name) as gameNameList
optional match(n)-[:labelThird]->(table)<-[:labelThird]-(m)
with n,m,gs,gameNameList, count(table) as ds, collect(table.name) as labelNameList
return m.userId as userId, m.userName as userName, gameNameList,labelNameList,
(0.4gs) + (0.2ds) - ABS(m.yearOfBirth-n.yearOfBirth)*0.4 as score order by score desc limit 1
有10万条数据,执行时间5s,