我一直很好奇的东西。
(假设您可以神奇地翻转 neo4j 中的关系方向)
哪个会更快?
START a=node(345)
MATCH (a)<-[:foo]-(b)<-[:bar]-(c)
RETURN c
或者
START a=node(345)
MATCH (a)-[:foo]->(b)-[:bar]->(c)
RETURN c
或者没关系,因为在引擎盖下,您可以向任一方向移动?
最佳答案
在 javadocs ( http://api.neo4j.org/current/org/neo4j/graphdb/Relationship.html ) 中找到答案
Even though all relationships have a direction they are equally well traversed in both directions so there's no need to create duplicate relationships in the opposite direction (with regard to traversal or performance).
这就是答案。
关于Neo4j - 关系方向会影响密码性能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18348818/