gpt4 book ai didi

java - neo4j Java API getRelationships 方法的时间复杂度

转载 作者:太空宇宙 更新时间:2023-11-04 06:43:07 25 4
gpt4 key购买 nike

文档中没有说明返回迭代器的方法有多复杂(或者我错过了)。

假设我正在寻找特定类型,因此我执行此操作:

node.getRelationships(RelType)

我有三种情况:

node has:

1) ~100k relations, where half of them has type RelType

2) ~1M relations, where half of them has type RelType

2) ~1M relations, where 50k has type RelType

它会影响返回迭代器所需的时间吗?

最佳答案

对于 Neo4j 2.1.x,所有这些都应该具有相同的特征。

对于超过(50或100)rels的节点的Als关系按类型和方向存储在结构中,它是直接访问和加载结构。

对于第一次访问,必须从磁盘加载关系链,对于后续访问,它将在内存中可用。

关于java - neo4j Java API getRelationships 方法的时间复杂度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24407600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com