gremlin - gremlin 中的 g.V(T.id) 或 g.V().hasLabel ('emaployee' ).has(T.id, 1) 哪个更快

标签 gremlin tinkerpop amazon-neptune janusgraph

apache Tinkerpop gremlin 中的 g.V(T.id)g.V().hasLabel('emaployee').has(T.id, 1) 哪个更快.

我有 idlabel 哪个更好,从编程角度来看 g.V(T.id) 更简单,但是什么关于数据库性能?两者一样吗?

最佳答案

您在标签中列出了多个数据库,因此我不确定您主要询问的是哪一个。一般来说,如果您知道 ID,则无需检查标签,因为 ID 必须是唯一的。您可能检查的唯一情况是您不确定给定的 ID 是否属于所需的标签类型。

一般来说,如果我知道 ID,我总是使用 g.V(some-id)

关于gremlin - gremlin 中的 g.V(T.id) 或 g.V().hasLabel ('emaployee' ).has(T.id, 1) 哪个更快,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73827494/

相关文章:

java - gremlin中的Join查询,分组结果形成一对多关系

python - 海王星内部故障异常 : Can not get the attachable from the host vertex

Neptune 上的 Gremlin 并发修改异常

graph - 从节点获取图中的所有路径,但仅获取终止的路径

graph - Bulbs/Gremlin/Titan 的关键索引

gremlin - 使用 JanusGraph 的 ReferenceEdge 序列化错误

java - 图从单个顶点遍历到 N 个顶点

java - AWS Neptune io.netty.handler.codec.CorruptedFrameException

python - 如何通过 gremlin-python 获取所有边、相关顶点以及相应的 id、标签和属性?

neo4j - 根据关系属性对节点进行排序/过滤