【问题标题】:How to speed up bulk operations in IBM Graph如何加快 IBM Graph 中的批量操作
【发布时间】:2016-08-25 22:29:04
【问题描述】:

我正在尝试使用 gremlin 查询在 IBM Graph 服务上填充我的图表。我正在使用 addVertex 并且正在分批进行。我正在使用的 gremlin 看起来像这样,而且看起来很慢

{"gremlin": 
    "def g = graph.traversal(); 
    graph.addVertex(T.label, "foo")";
    .
    .
    .
}

有没有办法加快速度

【问题讨论】:

    标签: graph-databases gremlin tinkerpop ibm-graph


    【解决方案1】:

    这个脚本的问题是每次都会编译它,这需要时间。如果你有 100 个,那么编译每个的时间肯定会加起来。更好的方法是编写一次脚本,然后将变量绑定到bindings 对象中。

    {
      "gremlin": "def g = graph.traversal();graph.addVertex(T.label, name)",
      "bindings": { "name": "foo" }
    }
    

    这种技术几乎适用于任何基于 Tinkerpop 构建并使用 Gremlin 作为 DSL 的数据库

    【讨论】:

    • 试图找出如何使用它并且在 tinkerpop 文档中找不到绑定,你能确定链接到它的文档吗? 没错,我不知道如何在我的 Gremlin 服务器上使用它
    猜你喜欢
    • 2017-06-04
    • 2010-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    • 1970-01-01
    • 2020-09-01
    • 1970-01-01
    相关资源
    最近更新 更多