Gremlin 查询提示 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Gremlin 查询提示

您可使用查询提示为 Amazon Neptune 中的特定 Gremlin 查询指定优化和计算策略。

通过使用以下语法向查询添加 withSideEffect 步骤来指定查询提示。

g.withSideEffect(hint, value)
  • hint – 确定要应用的提示的类型。

  • value – 确定要考虑的系统方面的行为。

例如,以下示例为如何在 Gremlin 遍历中包含 repeatMode 提示。

注意

所有 Gremlin 查询提示副作用的前缀为 Neptune#

g.withSideEffect('Neptune#repeatMode', 'DFS').V("3").repeat(out()).times(10).limit(1).path()

上述查询指示 Neptune 引擎遍历图形时要深度优先 (DFS),而不是默认的 Neptune 广度优先 (BFS)。

以下各节提供了可用查询提示及其用法的更多信息。