Skip to content

hugegraph在进行出度遍历时存在性能问题 #39

Closed

Description

@bigdata-eqxiu

描述:从一个已知节点出发,向外(out)遍历,直至不存在叶子节点为止
语句:g.V().hasId("xxx").repeat(out("look")).until(outE("look").count().is(0)).path()
数据:3000多条边+3000多个顶点; 上述语句执行花了12s+ 请问什么原因 可否优化

Activity

  1. zhoney commented on Aug 31, 2018

    @zhoney
    Contributor

    g.V().hasId("xxx").repeat(out("look")).until(outE("look").count().is(0)).path()

    执行时间长可能的原因:

    1. 这条语句通过广度优先进行层层搜索,每一层都查询了满足条件的顶点和边,有一定的访问量。
    2. 图本身有环路,导致大量循环,建议 repeat(out("look")) -> repeat(out("look").simplePath())
    3. 存储后端本身速度慢
      可以按此排查一下问题

    另外,对于第一条,我们开发了一个subgraphpaths API #43 ,可以从source vertex出发,以某种label和某种方向的边(可选)出发,返回到所有叶子节点和包含环路的路径(由顶点id组成),如果满足你的场景的话,可以用这个。

  2. zhoney commented on Sep 10, 2018

    @zhoney
    Contributor

    sugbraphpaths API拆分成了rays和rings API:
    rings:从一个vertex出发按照指定的方向和边label可达的所有环路的路径
    rays:从一个vertex出发按照指定的方向和边label到边界点(无法继续,相当于叶子节点)的路径

  3. fisherinbox commented on Oct 31, 2018

    @fisherinbox

    @zhoney 这个sugbraphpaths API具体怎么用,文档中没看到呢

  4. added a commit that references this issue on Nov 7, 2018
    82b361c
  5. added a commit that references this issue on Nov 8, 2018
    397c566
  6. added a commit that references this issue on Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions