기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
openCypher 쿼리 제한 시간 힌트
쿼리 제한 시간 동작은 쿼리 수준 쿼리 힌트를 사용하여 쿼리별로 구성할 수 있습니다QUERY:TIMEOUTMILLISECONDS. USING 절과 함께 사용해야 합니다. 쿼리 힌트는 음수가 아닌 값을 허용합니다.
- AWS CLI
-
aws neptunedata execute-open-cypher-query \
--endpoint-url https://your-neptune-endpoint:port \
--open-cypher-query "USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1"
자세한 내용은 AWS CLI 명령 참조의 execute-open-cypher-query를 참조하세요.
- SDK
-
import boto3
from botocore.config import Config
client = boto3.client(
'neptunedata',
endpoint_url='https://your-neptune-endpoint:port',
config=Config(read_timeout=None, retries={'total_max_attempts': 1})
)
response = client.execute_open_cypher_query(
openCypherQuery='USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1'
)
print(response['results'])
다른 언어의 AWS SDK 예제는 섹션을 참조하세요AWS SDK.
- awscurl
-
awscurl https://your-neptune-endpoint:port/openCypher \
--region us-east-1 \
--service neptune-db \
-X POST \
-d "query=USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1"
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. us-east-1을 Neptune 클러스터의 리전으로 바꿉니다.
- curl
-
curl https://your-neptune-endpoint:port/openCypher \
-d "query=USING QUERY:TIMEOUTMILLISECONDS 100 MATCH(n) RETURN n LIMIT 1"
쿼리 제한 시간 동작은 클러스터 수준 제한 시간 및 쿼리 수준 제한 시간의 최소값을 고려합니다. 쿼리 제한 시간 동작을 이해하려면 아래 예제를 참조하세요. 클러스터 수준 쿼리 제한 시간에 대한 자세한 내용은 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://your-neptune-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://your-neptune-endpoint:port/openCypher \
-d "query=USING QUERY:TIMEOUTMILLISECONDS 10000 MATCH(n) RETURN n LIMIT 1"
쿼리가 제한 시간을 초과하면 Neptune은 쿼리를 종료하고 제한 시간 오류를 반환합니다. 시간 초과 쿼리를 재시도할지 여부는 장애의 특성과 워크로드에 따라 달라집니다. 자세한 지침은 예외 처리 및 재시도을 참조하세요.