incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

Gremlin 语句优化

Open qingchengliu opened this issue 6 years ago • 1 comments

Expected behavior 期望表现

返回与实体 User 存在 out 关系的实体,并返回他们之间的边

g.V().hasLabel('User').has('uid','000001').union(hasLabel('User'),outE(),out())
g.V().hasLabel('User').has('uid','000001').outE().inV().path()

目前以上两个语句均可实现我的需求,但耗时较高。

Actual behavior 实际表现

关闭了server的缓存后,在 hugegraph-studio 中,显示第一个语句耗时 0.182s,第二个语句耗时 1.1s。

Vertex/Edge summary 数据量

节点:10w 边:5w

Specifications of environment 环境信息

  • hugegraph version: 0.10.4

qingchengliu avatar Feb 29 '20 08:02 qingchengliu

@qingchengliu 语句本身的话已经非常简单了,语句上没有可以优化的地方了。使用的后端是什么? studio的时间包括渲染邻居点的时间,建议使用api查看实际耗时,如果返回结果比较多则耗时会多,可以limit限制下结果数量。 或者在studio中可以通过count判断耗时的数量级:g.V().hasLabel('User').has('uid','000001').outE().inV().path().count()

javeme avatar Mar 02 '20 02:03 javeme