慢Gremlin查询返回21K节点属性

时间:2019-02-08 03:03:38

标签: gremlin janusgraph

运行以下gremlin查询时出现问题:

g.V().has('[label]', 'Customer').valueMap(true, 'customer_id')

我在'[label]'上使用混合索引,但是valueMap步骤在执行过程中仍然是同步的。这会导致查询性能降低,并且随着图形的增长而无法很好地扩展。

gremlin> g.V().has('[label]', 'Customer').valueMap(true, 'customer_id').profile()
==>Traversal Metrics
Step                                                               Count  Traversers       Time (ms)    % Dur
=============================================================================================================
JanusGraphStep([],[[label].eq(Customer)])                          21113       21113        1991.216     9.49
    \_condition=([label] = Customer)
    \_isFitted=true
    \_query=[([label] = Customer)]:node_label_mixed
    \_index=node_label_mixed
    \_orders=[]
    \_isOrdered=true
    \_index_impl=search
  optimization                                                                                 0.039
  optimization                                                                                 0.908
  backend-query                                                                                0.000
    \_query=node_label_mixed:[([label] = Customer)]:node_label_mixed
  backend-query                                                                                0.000
    \_query=node_label_mixed:[([label] = Customer)]:node_label_mixed
  backend-query                                                                                0.000
    \_query=node_label_mixed:[([label] = Customer)]:node_label_mixed
  backend-query                                                                                0.000
    \_query=node_label_mixed:[([label] = Customer)]:node_label_mixed
  backend-query                                                    21113                    5589.282
    \_query=node_label_mixed:[([label] = Customer)]:node_label_mixed
PropertyMapStep([customer_id],value)                               21113       21113       18982.089    90.51

是否有更好的方法来编制此查询,使其可以并行运行,以便获得一次获取所有节点属性的更好性能?

0 个答案:

没有答案