Neo4j - 关系方向会影响密码性能吗?

标签 neo4j cypher

我一直很好奇的东西。

(假设您可以神奇地翻转 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/

相关文章:

neo4j - 密码中每一行的拆分操作

neo4j - CYPHER 查询中的 LIKE 子句

java - Neo4j OGM @Properties 支持哪些条目类型?

java - neo4j : Limited queries sent in java

python - 我为 Neo4j 做的 Python 对象映射是否太天真了?

Neo4j Cypher Query 来聚合连接节点的数量

neo4j 查询排除与具有某些属性的节点相关的节点

neo4j - 在 Neo4j 中转换 EPOCH 日期

csv - 如何使用 cypher-shell neo4j 命令从终端运行密码脚本文件?

neo4j - 与 OR 条件匹配