【问题标题】:Why the vertex count is getting only in Development mode in DSE Graph为什么顶点数仅在 DSE Graph 的开发模式下获得
【发布时间】:2016-12-24 02:02:42
【问题描述】:

当我尝试使用 DSE Graph 获取顶点数时

g.V().count()

在生产模式下显示以下错误。

Could not find a suitable index to answer graph query and graph scans are disabled

但在开发模式下也是如此。我是不是做错了什么。

我正在尝试快速启动链接,但创建了自己的架构

https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/QuickStartStudio.html

架构:

schema.propertyKey("id").Int().single().create() schema.propertyKey("name").Text().single().create()

schema.edgeLabel("created").multiple().create()

schema.vertexLabel("feed").properties("id").create() schema.vertexLabel("user").properties("id", "name").create()

schema.vertexLabel("feed").index("byFeedId").materialized().by("id").add() schema.vertexLabel("user").index("byUser").materialized().by("id").add()

【问题讨论】:

    标签: datastax datastax-enterprise


    【解决方案1】:

    TL;DR

    计算您的顶点是一个昂贵的查询,预计不会在 OLTP 用例的生产环境中完成。

    为什么?

    在 DSE Graph 中,顶点按顶点类型存储在邻接列表中,要获得所有顶点的计数,您必须对每个顶点进行全表扫描,这在分布式事务系统中是不切实际的(您会必须命中整个副本集,这可能是很多节点)。

    这是一个真正的查询。我该怎么办?

    如果这是一个真实的用例,它可能是一个分析用例,在这种情况下,您应该通过在分析模式下运行查询来利用火花图计算机。 注意:全表扫描可能仍需要时间,但将通过 DSE Analytics 以大规模分布式方式执行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-05
      • 1970-01-01
      • 2021-02-08
      • 2017-06-05
      • 2017-06-27
      • 1970-01-01
      • 2020-08-14
      • 1970-01-01
      相关资源
      最近更新 更多