

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# openCypher 쿼리 계획 캐시 힌트
<a name="opencypher-query-hints-qpc-hint"></a>

 쿼리 수준 쿼리 힌트 `QUERY:PLANCACHE`를 사용하면 쿼리별(파라미터화 여부와 무관)로 쿼리 계획 캐시 동작을 재정의할 수 있습니다. `USING` 절과 함께 사용해야 합니다. 쿼리 힌트는 `enabled` 또는 `disabled`를 값으로 허용합니다. 쿼리 계획 캐시에 대한 자세한 내용은 [Amazon Neptune의 쿼리 계획 캐시](access-graph-qpc.md) 섹션을 참조하세요.

------
#### [ AWS CLI ]

캐시되거나 재사용되는 강제 계획:

```
aws neptunedata execute-open-cypher-query \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --open-cypher-query "Using QUERY:PLANCACHE \"enabled\" MATCH(n) RETURN n LIMIT 1"
```

파라미터 포함:

```
aws neptunedata execute-open-cypher-query \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --open-cypher-query "Using QUERY:PLANCACHE \"enabled\" RETURN \$arg" \
  --parameters '{"arg": 123}'
```

캐싱되거나 재사용되지 않도록 계획 강제 적용:

```
aws neptunedata execute-open-cypher-query \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --open-cypher-query "Using QUERY:PLANCACHE \"disabled\" MATCH(n) RETURN n LIMIT 1"
```

자세한 내용은 AWS CLI 명령 참조의 [execute-open-cypher-query](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/execute-open-cypher-query.html)를 참조하세요.

------
#### [ 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})
)

# Forcing plan to be cached or reused
response = client.execute_open_cypher_query(
    openCypherQuery='Using QUERY:PLANCACHE "enabled" MATCH(n) RETURN n LIMIT 1'
)

print(response['results'])
```

다른 언어의 AWS SDK 예제는 섹션을 참조하세요[AWS SDK](access-graph-opencypher-sdk.md).

------
#### [ awscurl ]

캐시되거나 재사용되는 강제 계획:

```
awscurl https://{{your-neptune-endpoint}}:{{port}}/openCypher \
  --region {{us-east-1}} \
  --service neptune-db \
  -X POST \
  -d "query=Using QUERY:PLANCACHE \"enabled\" MATCH(n) RETURN n LIMIT 1"
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. {{us-east-1}}을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

캐시되거나 재사용되는 강제 계획:

```
curl https://{{your-neptune-endpoint}}:{{port}}/openCypher \
  -d "query=Using QUERY:PLANCACHE \"enabled\" MATCH(n) RETURN n LIMIT 1"
```

파라미터 포함:

```
curl https://{{your-neptune-endpoint}}:{{port}}/openCypher \
  -d "query=Using QUERY:PLANCACHE \"enabled\" RETURN \$arg" \
  -d "parameters={\"arg\": 123}"
```

캐싱되거나 재사용되지 않도록 계획 강제 적용:

```
curl https://{{your-neptune-endpoint}}:{{port}}/openCypher \
  -d "query=Using QUERY:PLANCACHE \"disabled\" MATCH(n) RETURN n LIMIT 1"
```

------