

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# openCypher 查詢逾時提示
<a name="opencypher-query-hints-timeout-hint"></a>

 查詢逾時行為可以透過查詢層級查詢提示 依每個查詢進行設定`QUERY:TIMEOUTMILLISECONDS`。它必須與 `USING`子句搭配使用。查詢提示接受非負值。

```
# Using query-level timeout hint 

% curl https://<endpoint>:<port>/opencypher \
  -d "query=USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1"
```

 查詢逾時行為將考慮叢集層級逾時和查詢層級逾時的最小值。請參閱以下範例以了解查詢逾時行為。如需叢集層級查詢逾時的詳細資訊，請參閱 [neptune\$1query\$1timeout](https://docs.aws.amazon.com/neptune/latest/userguide/parameters.html#parameters-db-cluster-parameters-neptune_query_timeout)。

```
# Suppose `neptune_query_timeout` is 10000 ms and query-level timeout is set to 100 ms
# It will consider 100 ms as the final timeout 

% curl https://<endpoint>:<port>/opencypher \
  -d "query=USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1"

# Suppose `neptune_query_timeout` is 100 ms and query-level timeout is set to 10000 ms
# It will still consider 100 ms as the final timeout 

% curl https://<endpoint>:<port>/opencypher \
  -d "query=USING QUERY:TIMEOUTMILLISECONDS 10000 MATCH(n) RETURN n LIMIT 1"
```