【问题标题】:Explain plan in gremlin Tinkerpop3 (DSE graph)在 gremlin Tinkerpop3 中解释计划(DSE 图)
【发布时间】:2017-02-01 05:09:12
【问题描述】:

我写了一个查询,它花费的时间比预期的要长。

g.V().hasLabel('Person').has('name','Person1').out('BELONGS').in('HAS').dedup().as('x').in('HAS').filter(__.in('HAS').has('name','App1')).store('y').select('x').dedup().in('HAS').hasLabel('Org').repeat(out()).until(outE().hasLabel('IS')).store('a').cap('y').unfold().in('HAS').hasLabel('Class').repeat(inE('IS').dedup().otherV()).until(inE('HAS')).where(within('a'))

我们可以做一个解释计划来看看是什么让这个查询变慢了吗?

问候

瓦伦塔欣

【问题讨论】:

    标签: datastax-enterprise gremlin tinkerpop3 datastax-enterprise-graph


    【解决方案1】:

    在分解 Gremlin 遍历时,您可以使用多种工具。您可以使用explain() 步骤和/或profile() 步骤。 explain() 步骤将显示遍历是如何由优化其执行的遍历策略组成和修改的。 profile() 步骤将提供有关遍历执行本身的统计信息。

    我还将 Gremlin 控制台本身称为“工具”。调试 Gremlin 有时会让我走上一条执行较小遍历块的路径,以便我可以确定它在步骤列表中的任何给定点返回的内容。 Gremlin 控制台,因为它是一个 REPL,提供了获得关于代码执行的即时反馈的能力,从而让您摆脱 IDE 的较长开发周期。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 2016-12-08
      • 1970-01-01
      • 2023-03-10
      • 2017-05-29
      • 2012-11-12
      相关资源
      最近更新 更多