

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

# Gremlin 查询提示
<a name="gremlin-query-hints"></a>

您可使用查询提示为 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`)。

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

**Topics**
+ [Gremlin repeatMode 查询提示](gremlin-query-hints-repeatMode.md)
+ [Gremlin noReordering 查询提示](gremlin-query-hints-noReordering.md)
+ [Gremlin typePromotion 查询提示](gremlin-query-hints-typePromotion.md)
+ [Gremlin useDFE 查询提示](gremlin-query-hints-useDFE.md)
+ [使用结果缓存的 Gremlin 查询提示](gremlin-query-hints-results-cache.md)