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

请教gremlin查询优化(原理)

Open 860960342 opened this issue 6 years ago • 3 comments

需求:查询指定顶点的一步邻居,返回关联情况

实验环境:hugegraph-server-0.10.4+hbase-XX

顶点量1000w+,边数量1亿 当前hugegraph-server非空闲状态,在频繁做其他的查询操作

首先指定顶点的邻居节点数量只有9个:g.V('test-001').out().count()

然后在studio中分别做如下查询: image

其中标签为label3的边有1000w+,每个节点有且只有一个标签为label3的边

想请教一下:

  1. 为什么out()、out().path()、out(label).path()、outE()、outE(label) 、outE(label).path()的查询有的可以查询,有的查询异常,有的快,有的慢?
  2. 所有边标签都建了索引,为什么查询时加上边标签反而速度变慢了?
  3. 可以介绍一下内部的查询原理吗?

860960342 avatar Apr 10 '20 09:04 860960342

@860960342 如果需要测时间,请直接使用接口测试,因为studio会渲染返回结果(为了渲染图需要获取结果的邻接点)。

javeme avatar Apr 10 '20 16:04 javeme

@javeme 感谢回复,用gremlin-api重新查询了一遍,都可以正常返回结果。 关于 g.V('test-001').outE('label3').inV().path() 在studio里执行 failed to do request的情况,是这样理解吗: 首先查询得到 源节点test-001,边edge-1,目标节点test-002 然后 分别获取test-001、edge-1、test-002的邻节点 由于test-002的邻节点有1000w+,导致这一步查询异常,进而failed to do request

860960342 avatar Apr 13 '20 01:04 860960342

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] avatar Aug 13 '21 21:08 github-actions[bot]