代码之家  ›  专栏  ›  技术社区  ›  takaomag

JanusGraph索引仅用于查找条目元素?

  •  1
  • takaomag  · 技术社区  · 7 年前

    所有索引(复合索引、混合索引和顶点中心索引)仅用于查找入口点元素?

    例如,在以下遍历中,索引仅用于 has('Lang', 'name', 'python')

    g.V().has('Lang', 'name', 'python').in('use').has('person', 'age', P.gt(28)).toList()
    

    如果是这样,当一个中间顶点有这么多边(超级节点)时,JanusGraph必须从后端存储中读取这么多元素才能过滤?

    1 回复  |  直到 7 年前
        1
  •  4
  •   Daniel Kuppitz    7 年前

    vertex centric indexes 以提高遍历的性能。例如,您可以复制此人的年龄属性(也可以将其存储在 use

    mgmt.buildEdgeIndex(uses, "usedByAge", Direction.IN, Order.incr, age);