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

gremlin 语句优化

Open qingchengliu opened this issue 6 years ago • 2 comments

Expected behavior 期望表现

二度关联并返回点、边数据,以下语句该如何优化?

g.V().hasLabel('User').has('uid','%s').union(hasLabel('P'),outE(),out(),out('P_CONN').outE(),out(P_CONN').out('DEVICE_CONN'))

Specifications of environment 环境信息

  • hugegraph version: v0.10.4
  • operating system: {like centos 7.4, 32 CPUs, 64G RAM}
  • hugegraph backend: {like cassandra 3.10, cluster with 20 nodes, 3 x 1TB HDD disk each node}

qingchengliu avatar Feb 29 '20 04:02 qingchengliu

@qingchengliu 不太清楚上述语句具体的意图,请描述一下你的需求才好优化。

javeme avatar Feb 29 '20 05:02 javeme

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

@javeme

qingchengliu avatar Feb 29 '20 11:02 qingchengliu